Commit graph

4 commits

Author SHA1 Message Date
Albert Krewinkel
24ef672132 Lua module: provide simple read format parser
A single `read` function parsing pandoc-supported formats is added to
the module. This is simpler and more convenient than the previous method
of exposing all reader functions individually.
2017-04-26 23:28:40 +02:00
Albert Krewinkel
e6a536befc
Lua filter: revert to non-destructuring filters
We want to provide an interface familiar to users of other filtering
libraries.
2017-04-15 21:40:48 +02:00
Albert Krewinkel
07f41a5515
Lua filter: use destructured functions for block filters
Filtering functions take element components as arguments instead of the
whole block elements. This resembles the way elements are handled in
custom writers.
2017-04-14 11:34:44 +02:00
Albert Krewinkel
e7eb21ecca
Lua module: add readers submodule
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-04-02 17:28:07 +02:00