aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Lua.hs
AgeCommit message (Collapse)AuthorFilesLines
2017-04-04Use lua registry instead of named globalsAlbert Krewinkel1-5/+11
This is slightly cleaner while keeping performance approximately the same.
2017-04-02Lua module: add readers submoduleAlbert Krewinkel1-28/+3
Plain text readers are exposed to lua scripts via the `pandoc.reader` submodule, which is further subdivided by format. Converting e.g. a markdown string into a pandoc document is possible from within lua: doc = pandoc.reader.markdown.read_doc("Hello, World!") A `read_block` convenience function is provided for all formats, although it will still parse the whole string but return only the first block as the result. Custom reader options are not supported yet, default options are used for all parsing operations.
2017-03-20Lua filters (#3514)Albert Krewinkel1-0/+226
* Add `--lua-filter` option. This works like `--filter` but takes pathnames of special lua filters and uses the lua interpreter baked into pandoc, so that no external interpreter is needed. Note that lua filters are all applied after regular filters, regardless of their position on the command line. * Add Text.Pandoc.Lua, exporting `runLuaFilter`. Add `pandoc.lua` to data files. * Add private module Text.Pandoc.Lua.PandocModule to supply the default lua module. * Add Tests.Lua to tests. * Add data/pandoc.lua, the lua module pandoc imports when processing its lua filters. * Document in MANUAL.txt.