I'm trying to bind Header_1 to some docx style.
This sample Lua filter function should output a header level each time it finds one:
function Header(el)
print(el.level)
end
The source reStructured text code:
***************
Header 1 sample
***************
Text
Header 2 sample
===============
Text2
Header 2 sample
===============
Text2
In a command line this should print 1, 2, 2:
pandoc --lua-filter=rst2docxHead.lua -f rst -t json test.rst
1
2
2
{"blocks":[{"t":"Header","c":[1,["header-1-sample",[],[]
So, let's see how in converts to docx…
$ pandoc --lua-filter=rst2docxHead.lua -f rst -t docx -o test.docx test.rst
1
1
For some reason in this configuration the top level header is not processed and seems to be directly passed to docx output as a document title.