Coder Social home page Coder Social logo

Comments (5)

helpatbbf avatar helpatbbf commented on August 19, 2024

--filter runs a program:

% pandoc --help | grep filter
  -F PROGRAM            --filter=PROGRAM                                      
  -L SCRIPTPATH         --lua-filter=SCRIPTPATH     

Is this the standard list-table.lua? If it was executable (it would presumably need a lua shebang line) I guess it would run standalone and perhaps you'd get this output, but when I try it I just get this:

% pandoc simple.md --filter ./list-table.lua 
Error running filter ./list-table.lua:
Could not find executable ./list-table.lua

from list-table.

wlupton avatar wlupton commented on August 19, 2024

(Sorry, that was me logged in as the wrong user.)

from list-table.

julianbarg avatar julianbarg commented on August 19, 2024

I tried it as both an executable and non-executable. Yes, I got that error message, too, and so I ran chmod +x on the file to "advance" to the error message above.

from list-table.

wlupton avatar wlupton commented on August 19, 2024

OK. Did you also add a shebang line? I'm guessing that you did something like this (I didn't know that this worked):

#!/usr/bin/env lua
-- lua filter for RST-like list-tables in Markdown.
-- Copyright (C) 2021 Martin Fischer, released under MIT license

if PANDOC_VERSION and PANDOC_VERSION.must_be_at_least then
    PANDOC_VERSION:must_be_at_least("2.11")
else
    error("pandoc version >=2.11 is required")
end
...

With this I get the same as you:

% pandoc simple.md --filter ./list-table.lua 
lua: ././list-table.lua:8: pandoc version >=2.11 is required
stack traceback:
	[C]: in function 'error'
	././list-table.lua:8: in main chunk
	[C]: in ?
Error running filter ./list-table.lua:
Filter returned error status 1

This happens because the lua script is running as a standalone executable and isn't receiving any lua context from pandoc, so PANDOC_VERSION is nil, the if test fails, and you get the error message.

But the bottom line is that this was never going to work! Do you now see why? If not, I suggest re-reading the relevant section of the manual.

from list-table.

julianbarg avatar julianbarg commented on August 19, 2024

I see, that makes sense. The debugging experience was frustrating, but that seems to be on pandoc's side.

from list-table.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.