@@ -2,7 +2,21 @@ Lua Filters
22===========
33
44Pandoc expects lua files to return a list of filters. The filters in that list
5−are called sequentially, each on the result of the previous filter.
5+are called sequentially, each on the result of the previous filter. If there is
6+no value returned by the filter script, then pandoc will try to generate a
7+filter by collecting all top-level functions whose names correspond to those of
8+pandoc elements (e.g., `Str`, `Para`, `Meta`, or `Pandoc`).
9+
10+Filters are expected to be put into separate files and are passed via the
11+`--lua-filter` command-line argument. E.g., if a filter is defined in a file
12+`current-date.lua`, then it would be applied like this:
13+
14+ pandoc --lua-filter=current-date.lua -f markdown MANUAL.txt
15+
16+The `--lua-filter` can be supplied multiple times, causing the filters to be
17+applied sequentially in the order they were given. If other, non-Lua filters are
18+given as well (via `--filter`), then those are executed *after* all Lua filters
19+have been applied.
620
721Lua Filter Structure
822--------------------
@@ -45,7 +59,7 @@ functions and access to some of pandoc's main functionalities.
4559Element creation
4660----------------
4761
48−Element creator functions like `Str`, `Para`, and `Doc` are designed to
62+Element creator functions like `Str`, `Para`, and `Pandoc` are designed to
4963allow easy creation of new elements that are simple to use and can be
5064read back from the lua environment. Internally, pandoc uses these
5165functions to create the lua objects which are passed to element filter