@@ -29,13 +29,13 @@ used by anyone who has a certain version of the pandoc
29executable.
29executable.
31Starting with version 2.0, pandoc makes it possible to write
31Starting with version 2.0, pandoc makes it possible to write
32−filters in lua without any external dependencies at all. A lua
32+filters in Lua without any external dependencies at all. A Lua
33−interpreter (version 5.3) and a lua library for creating pandoc
33+interpreter (version 5.3) and a Lua library for creating pandoc
34filters is built into the pandoc executable. Pandoc data types
34filters is built into the pandoc executable. Pandoc data types
35−are marshalled to lua directly, avoiding the overhead of writing
35+are marshalled to Lua directly, avoiding the overhead of writing
36JSON to stdout and reading it from stdin.
36JSON to stdout and reading it from stdin.
38−Here is an example of a lua filter that converts strong emphasis
38+Here is an example of a Lua filter that converts strong emphasis
39to small caps:
39to small caps:
@@ -74,7 +74,7 @@ Python (`smallcaps.py`):
74 `pandoc --filter ./smallcaps.py` 1.40s
74 `pandoc --filter ./smallcaps.py` 1.40s
75 `pandoc --lua-filter ./smallcaps.lua` 1.03s
75 `pandoc --lua-filter ./smallcaps.lua` 1.03s
77−As you can see, the lua filter avoids the substantial overhead
77+As you can see, the Lua filter avoids the substantial overhead
78associated with marshalling to and from JSON over a pipe.
78associated with marshalling to and from JSON over a pipe.
80# Lua filter structure
80# Lua filter structure
@@ -91,10 +91,10 @@ then it would be applied like this:
92The `--lua-filter` option may be supplied multiple times. Pandoc
92The `--lua-filter` option may be supplied multiple times. Pandoc
93applies all filters (including JSON filters specified via
93applies all filters (including JSON filters specified via
94−`--filter` and lua filters specified via `--lua-filter`) in the
94+`--filter` and Lua filters specified via `--lua-filter`) in the
95order they appear on the command line.
95order they appear on the command line.
97−Pandoc expects each lua file to return a list of filters. The
97+Pandoc expects each Lua file to return a list of filters. The
98filters in that list are called sequentially, each on the result
98filters in that list are called sequentially, each on the result
99of the previous filter. If there is no value returned by the
99of the previous filter. If there is no value returned by the
100filter script, then pandoc will try to generate a single filter
100filter script, then pandoc will try to generate a single filter
@@ -104,7 +104,7 @@ those of pandoc elements (e.g., `Str`, `Para`, `Meta`, or
105For each filter, the document is traversed and each element
105For each filter, the document is traversed and each element
106subjected to the filter. Elements for which the filter contains
106subjected to the filter. Elements for which the filter contains
107−an entry (i.e. a function of the same name) are passed to lua
107+an entry (i.e. a function of the same name) are passed to Lua
108element filtering function. In other words, filter entries will
108element filtering function. In other words, filter entries will
109be called for each corresponding element in the document,
109be called for each corresponding element in the document,
110getting the respective element as input.
110getting the respective element as input.
@@ -208,7 +208,7 @@ variables.
209# Pandoc Module
209# Pandoc Module
211−The `pandoc` lua module is loaded into the filter's lua
211+The `pandoc` Lua module is loaded into the filter's Lua
212environment and provides a set of functions and constants to
212environment and provides a set of functions and constants to
213make creation and manipulation of elements easier. The global
213make creation and manipulation of elements easier. The global
214variable `pandoc` is bound to the module and should generally
214variable `pandoc` is bound to the module and should generally
@@ -222,15 +222,15 @@ functionalities.
223Element creator functions like `Str`, `Para`, and `Pandoc` are
223Element creator functions like `Str`, `Para`, and `Pandoc` are
224designed to allow easy creation of new elements that are simple
224designed to allow easy creation of new elements that are simple
225−to use and can be read back from the lua environment.
225+to use and can be read back from the Lua environment.
226−Internally, pandoc uses these functions to create the lua
226+Internally, pandoc uses these functions to create the Lua
227objects which are passed to element filter functions. This means
227objects which are passed to element filter functions. This means
228that elements created via this module will behave exactly as
228that elements created via this module will behave exactly as
229those elements accessible through the filter function parameter.
229those elements accessible through the filter function parameter.
231## Exposed pandoc functionality
231## Exposed pandoc functionality
233−Some pandoc functions have been made available in lua:
233+Some pandoc functions have been made available in Lua:
235- [`walk_block`](#pandoc.walk_block) and
235- [`walk_block`](#pandoc.walk_block) and
236 [`walk_inline`](#pandoc.walk_inline) allow filters to be applied
236 [`walk_inline`](#pandoc.walk_inline) allow filters to be applied
@@ -269,7 +269,7 @@ colon syntax (`mystring:uc_upper()`).
269# Examples
269# Examples
271The following filters are presented as examples. A repository of
271The following filters are presented as examples. A repository of
272−useful lua filters (which may also serve as good examples) is
272+useful Lua filters (which may also serve as good examples) is
273available at <https://github.com/pandoc/lua-filters>.
273available at <https://github.com/pandoc/lua-filters>.
275## Macro substitution
275## Macro substitution
@@ -2478,7 +2478,7 @@ Parameters:
2478: the block element
2478: the block element
2480`filter`:
2480`filter`:
2481−: a lua filter (table of functions) to be applied within the
2481+: a Lua filter (table of functions) to be applied within the
2482 block element
2482 block element
2484Returns: the transformed block element
2484Returns: the transformed block element
@@ -2495,7 +2495,7 @@ Parameters:
2495: the inline element
2495: the inline element
2497`filter`:
2497`filter`:
2498−: a lua filter (table of functions) to be applied within the
2498+: a Lua filter (table of functions) to be applied within the
2499 inline element
2499 inline element
2501Returns: the transformed inline element
2501Returns: the transformed inline element