096cbe6987
* Lua: allow access to pandoc state Lua filters and custom writers now have read-only access to most fields of pandoc's internal state via the global variable `PANDOC_STATE`. * Lua: allow iterating through fields of PANDOC_STATE * Lua filters doc: describe CommonState * Lua filters doc: mention global variable PANDOC_STATE * Lua: add access to logs Log messages can currently only be printed, but not decomposed.
11 lines
514 B
Lua
11 lines
514 B
Lua
function report (what, value)
|
|
print(string.format('%16s: %s', what, value))
|
|
end
|
|
report('# input files', #PANDOC_STATE.input_files)
|
|
report('output file', PANDOC_STATE.output_file)
|
|
report('# request header', #PANDOC_STATE.request_headers)
|
|
report('resource path', table.concat(PANDOC_STATE.resource_path, ', '))
|
|
report('source URL', PANDOC_STATE.source_url)
|
|
report('user data dir', PANDOC_STATE.user_data_dir and 'defined' or 'unset')
|
|
report('trace', PANDOC_STATE.trace)
|
|
report('verbosity', PANDOC_STATE.verbosity)
|