-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Starting with panzer 1.4, lua filters are supported (many thanks to @msprev !!). So I tried some lua filters that I wrote myself, and none of them got expected behaviour. In fact, it seems lua filters are receiving JSON, when should receive AST instead (according to pandoc's doc on lua filters).
For instance, I have this lua filter (very first example on lua filters in pandoc's doc). It should turn Strong elements into SmallCaps elements:
function Strong(elem)
return pandoc.SmallCaps(elem.c)
endRunning directly with pandoc, it works. Using panzer, nothing happens. Below is my styles.yaml (excerpt), which only puts that lua filter to run:
Base:
all:
metadata:
numbersections: true
lang: "pt-BR"
commandline:
standalone: true
lua-filter:
- run: myfilter.luaThe filter is correctly found by panzer, and apparently runs, but no errors on lua-filter are shown when running panzer. Even print('some debug') doesn't output anything to console. I tried to use JSON on the lua filter, but I couldn't realize how to do that. My first try was like code below, withou any results:
function test(key, value, format, meta)
return pandoc.Str(value)
end
toJSONFilter(test)Am I missing something?