You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried unsuccessfully to use a variable like -V foo as a boolean in Lua.
Something like -M foo, -M foo=true or -M foo=false does indeed result in a boolean value for that metadata field in Lua.
[EDIT: note that -M foo without a value results in a true value!]
With -V foopandoc.utils.type returns "Doc" for the value of PANDOC_WRITER_OPTIONS.variables.foo, but apparently that value stringifies to "true"! I find this doubly confusing as I had expected a boolean.
Using a variable for a filter switch would be more convenient as it could be accessed "directly" rather than writing a Meta filter which extracts the value from metadata and assigns it to a script-wide variable before running the main filter.
Obviously I could write code which converts a Doc to a string and a string which "looks like a bool" to a bool but should that really be necessary?
Originally posted by @bpj in #10340 where @tarleb said I should report this as a bug.
The text was updated successfully, but these errors were encountered:
I tried unsuccessfully to use a variable like
-V foo
as a boolean in Lua.Something like
-M foo
,-M foo=true
or-M foo=false
does indeed result in a boolean value for that metadata field in Lua.[EDIT: note that
-M foo
without a value results in atrue
value!]With
-V foo
pandoc.utils.type
returns "Doc" for the value ofPANDOC_WRITER_OPTIONS.variables.foo
, but apparently that value stringifies to "true"! I find this doubly confusing as I had expected a boolean.Using a variable for a filter switch would be more convenient as it could be accessed "directly" rather than writing a Meta filter which extracts the value from metadata and assigns it to a script-wide variable before running the main filter.
Obviously I could write code which converts a Doc to a string and a string which "looks like a bool" to a bool but should that really be necessary?
Originally posted by @bpj in #10340 where @tarleb said I should report this as a bug.
The text was updated successfully, but these errors were encountered: