pandoc/test/command/lua-pandoc-state.md
Albert Krewinkel 096cbe6987 Lua: allow access to pandoc state (#5015)
* 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.
2018-10-25 22:12:14 -07:00

14 lines
261 B
Markdown

```
% pandoc --lua-filter=command/lua-pandoc-state.lua
Hello
^D
# input files: 0
output file: nil
# request header: 0
resource path: .
source URL: nil
user data dir: defined
trace: false
verbosity: WARNING
<p>Hello</p>
```