Exposes a function converting which flattenes a list of blocks into a
list of inlines. An example use case would be the conversion of Note
elements into other inlines.
All "helper functions" are not part of the Lua code for module pandoc,
but are added in Haskell. The respective documentation section must
therefore be excluded from automatic regeneration.
The function `global_filter` was used internally to get the implicitly
defined global filter. It was of little value to end-users, but caused
unnecessary code duplication in pandoc. The function has hence been
dropped. Internally, the global filter is now received by interpreting
the global table as lua filter.
This is a Lua API change.
These docs are dropped, as the functions are no longer part of
data/pandoc.lua, from which this section is generated. This is only a
temporary fix: a proper fix will have to re-think how this section is
updated.
The file `init.lua` is used to initialize the Lua interpreter which is
used in Lua filters. This gives users the option to require libraries
which they want to use in all of their filters, and to extend default
modules.
Pandoc and Meta elements are now pushed by calling the respective
constructor functions of the pandoc Lua module. This makes serialization
consistent with the way blocks and inlines are pushed to lua and allows
to use List methods with the `blocks` value.
Refactored some code from Text.Pandoc.Lua.PandocModule
into new internal module Text.Pandoc.Lua.Filter.
Add `walk_inline` and `walk_block` in pandoc lua module.
Now 'fetch' simply fetches content and mime type.
A new 'hashname' function is provided to get a filename based
on the sha1 hash of the contents and the mime type.
The pandoc module documentation in doc/lua-filters.md was automatically
generated from `data/pandoc.lua`. A make target is provided which uses
a lua filter to update the documentation.
The documentation was generated from `data/pandoc.lua` using the
following command:
ldoc -l doc -d /tmp data/pandoc.lua;
pandoc -t markdown --columns=65 \
--atx-headers /tmp/index.html >> \
doc/lua-filters.md