Custom writers
Pandoc can be extended with custom writers written in lua. (Pandoc includes a lua interpreter, so lua need not be installed separately.)
To use a custom writer, simply specify the path to the lua script in place of the output format. For example:
pandoc -t data/sample.lua
Creating a custom writer requires writing a lua function for each possible element in a pandoc document. To get a documented example which you can modify according to your needs, do
pandoc --print-default-data-file sample.lua