Replies: 1 comment
|
It says "Accessing this variable in custom writers is deprecated." Not sure this applies to filters. @tarleb ? |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'm looking at ways to pass parameters to Lua filters (and also to custom readers/writers).
The
-Moption works well, especially for boolean (-M myFlag) and string (-M myVar=test) values.You just setup a filter like this:
I don't know how to read parameters passed with
-V(--variable) and--variable-jsonoptions, except for the deprecatedPANDOC_WRITER_OPTIONS.variablestable.The
PANDOC_WRITER_OPTIONSglobal variable (aWriterOptionsobject) works in filters too, and it has avariablesfield with the variables passed through-V, but unfortunately its use is deprecated.In custom writers, you get the
WriterOptionsobject through the second argument ofWriterandByteStringWriterfunctions; so parameters passed with-Vare available.In filters, it looks like the only way to pass parameters is using the
-Moption (or environment variables).Since you're adding metadata, you should take care of removing them, when they're just processing parameters, not to get them in the resulting document. Anyways, this is a minor problem.
In custom readers, there's no
variablesfield inReaderOptions, so it looks like the only way to pass parameters is using environment variables.Is it really like this?
All reactions