How to construct Sources
in lua?
#10668
-
I'm trying to pass a file name to |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There is currently no way to construct We could think about adding a local mimetype, content = pandoc.mediabag.fetch(FILENAME) Or, if one doesn't want to assign a variable, |
Beta Was this translation helpful? Give feedback.
There is currently no way to construct
Sources
items in Lua scripts. Pandoc passes a list ofSources
to custom readers, so that the reader has access to the filenames and can access files separately if needed. Theread
function accepts Sources for convenience and for backwards compatibility, because pandoc used to pass only a single string at first.We could think about adding a
pandoc.Sources
constructor, but I'm not sure if it would be worth the effort. Thepandoc.mediabag.fetch
function alreday provides a way to access a file's content with a single function call:Or, if one doesn't want to assign a variable,
pandoc.read(select(…