Search code examples
filterluapandoc

Pandoc Lua filter get filename of current document


I'm writing a Lua filter which need to utilize the filename of the document which is being processed, is this possible to do?

Lua filter:

local handle = io.popen("git log FILE")
local log = handle:read("*a")
handle:close()

In the above I need to use the actual filename of the document being processed to get the log for that specific file to include in the output document.


Solution

  • PANDOC_STATE.input_files is a List of strings with the input files provided through the command line.