git.iko.soy/typeable/pandoc
on master help sign in
docs: capitalize Lua where it refers to the programming language name
11e9940Albert Krewinkel
MANUAL.txt+15−15
@@ -325,7 +325,7 @@ header when requesting a document from a URL:
325 - `tei` ([TEI Simple])
325 - `tei` ([TEI Simple])
326 - `xwiki` ([XWiki markup])
326 - `xwiki` ([XWiki markup])
327 - `zimwiki` ([ZimWiki markup])
327 - `zimwiki` ([ZimWiki markup])
328− - the path of a custom lua writer, see [Custom writers] below
328+ - the path of a custom Lua writer, see [Custom writers] below
329 :::
329 :::
330
330
331 Note that `odt`, `docx`, `epub`, and `pdf` output will not be directed
331 Note that `odt`, `docx`, `epub`, and `pdf` output will not be directed
@@ -574,22 +574,22 @@ header when requesting a document from a URL:
574
574
575 3. `$PATH` (executable only)
575 3. `$PATH` (executable only)
576
576
577− Filters and lua-filters are applied in the order specified
577+ Filters and Lua-filters are applied in the order specified
578 on the command line.
578 on the command line.
579
579
580`-L` *SCRIPT*, `--lua-filter=`*SCRIPT*
580`-L` *SCRIPT*, `--lua-filter=`*SCRIPT*
581
581
582: Transform the document in a similar fashion as JSON filters (see
582: Transform the document in a similar fashion as JSON filters (see
583− `--filter`), but use pandoc's build-in lua filtering system. The given
583+ `--filter`), but use pandoc's build-in Lua filtering system. The given
584− lua script is expected to return a list of lua filters which will be
584+ Lua script is expected to return a list of Lua filters which will be
585− applied in order. Each lua filter must contain element-transforming
585+ applied in order. Each Lua filter must contain element-transforming
586 functions indexed by the name of the AST element on which the filter
586 functions indexed by the name of the AST element on which the filter
587 function should be applied.
587 function should be applied.
588
588
589− The `pandoc` lua module provides helper functions for element
589+ The `pandoc` Lua module provides helper functions for element
590− creation. It is always loaded into the script's lua environment.
590+ creation. It is always loaded into the script's Lua environment.
591
591
592− The following is an example lua script for macro-expansion:
592+ The following is an example Lua script for macro-expansion:
593
593
594 function expand_hello_world(inline)
594 function expand_hello_world(inline)
595 if inline.c == '{{helloworld}}' then
595 if inline.c == '{{helloworld}}' then
@@ -601,7 +601,7 @@ header when requesting a document from a URL:
601
601
602 return {{Str = expand_hello_world}}
602 return {{Str = expand_hello_world}}
603
603
604− In order of preference, pandoc will look for lua filters in
604+ In order of preference, pandoc will look for Lua filters in
605
605
606 1. a specified full or relative path (executable or
606 1. a specified full or relative path (executable or
607 non-executable)
607 non-executable)
@@ -1477,7 +1477,7 @@ include-after-body: []
1477include-in-header: []
1477include-in-header: []
1478resource-path: ["."]
1478resource-path: ["."]
1479
1479
1480−# filters will be assumed to be lua filters if they have
1480+# filters will be assumed to be Lua filters if they have
1481# the .lua extension, and json filters otherwise. But
1481# the .lua extension, and json filters otherwise. But
1482# the filter type can also be specified explicitly, as shown:
1482# the filter type can also be specified explicitly, as shown:
1483filters:
1483filters:
@@ -5829,15 +5829,15 @@ same styles in your input and output files.
5829
5829
5830# Custom writers
5830# Custom writers
5831
5831
5832−Pandoc can be extended with custom writers written in [lua]. (Pandoc
5832+Pandoc can be extended with custom writers written in [Lua]. (Pandoc
5833−includes a lua interpreter, so lua need not be installed separately.)
5833+includes a Lua interpreter, so Lua need not be installed separately.)
5834
5834
5835−To use a custom writer, simply specify the path to the lua script
5835+To use a custom writer, simply specify the path to the Lua script
5836in place of the output format. For example:
5836in place of the output format. For example:
5837
5837
5838 pandoc -t data/sample.lua
5838 pandoc -t data/sample.lua
5839
5839
5840−Creating a custom writer requires writing a lua function for each
5840+Creating a custom writer requires writing a Lua function for each
5841possible element in a pandoc document. To get a documented example
5841possible element in a pandoc document. To get a documented example
5842which you can modify according to your needs, do
5842which you can modify according to your needs, do
5843
5843
@@ -5850,7 +5850,7 @@ default template with the name
5850`default.NAME_OF_CUSTOM_WRITER.lua` to the `templates`
5850`default.NAME_OF_CUSTOM_WRITER.lua` to the `templates`
5851subdirectory of your user data directory (see [Templates]).
5851subdirectory of your user data directory (see [Templates]).
5852
5852
5853−[lua]: http://www.lua.org
5853+[Lua]: http://www.lua.org
5854
5854
5855# A note on security
5855# A note on security
5856
5856
README.md+2−2
@@ -169,7 +169,7 @@ It can convert *to*
169 markup](https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/XWikiSyntax/))
169 markup](https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/XWikiSyntax/))
170 - `zimwiki` ([ZimWiki
170 - `zimwiki` ([ZimWiki
171 markup](http://zim-wiki.org/manual/Help/Wiki_Syntax.html))
171 markup](http://zim-wiki.org/manual/Help/Wiki_Syntax.html))
172− - the path of a custom lua writer, see [Custom
172+ - the path of a custom Lua writer, see [Custom
173 writers](https://pandoc.org/MANUAL.html#custom-writers) below
173 writers](https://pandoc.org/MANUAL.html#custom-writers) below
174
174
175</div>
175</div>
@@ -188,7 +188,7 @@ convert this native representation into a target format. Thus, adding an
188input or output format requires only adding a reader or writer. Users
188input or output format requires only adding a reader or writer. Users
189can also run custom pandoc filters to modify the intermediate AST (see
189can also run custom pandoc filters to modify the intermediate AST (see
190the documentation for [filters](https://pandoc.org/filters.html) and
190the documentation for [filters](https://pandoc.org/filters.html) and
191−[lua filters](https://pandoc.org/lua-filters.html)).
191+[Lua filters](https://pandoc.org/lua-filters.html)).
192
192
193Because pandoc’s intermediate representation of a document is less
193Because pandoc’s intermediate representation of a document is less
194expressive than many of the formats it converts between, one should not
194expressive than many of the formats it converts between, one should not
doc/lua-filters.md+15−15
@@ -29,13 +29,13 @@ used by anyone who has a certain version of the pandoc
29executable.
29executable.
30
30
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.
37
37
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:
40
40
41``` lua
41``` lua
@@ -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
76
76
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.
79
79
80# Lua filter structure
80# Lua filter structure
@@ -91,10 +91,10 @@ then it would be applied like this:
91
91
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.
96
96
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
104
104
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.
208
208
209# Pandoc Module
209# Pandoc Module
210
210
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.
222
222
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.
230
230
231## Exposed pandoc functionality
231## Exposed pandoc functionality
232
232
233−Some pandoc functions have been made available in lua:
233+Some pandoc functions have been made available in Lua:
234
234
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
270
270
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>.
274
274
275## Macro substitution
275## Macro substitution
@@ -2478,7 +2478,7 @@ Parameters:
2478: the block element
2478: the block element
2479
2479
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
2483
2483
2484Returns: the transformed block element
2484Returns: the transformed block element
@@ -2495,7 +2495,7 @@ Parameters:
2495: the inline element
2495: the inline element
2496
2496
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
2500
2500
2501Returns: the transformed inline element
2501Returns: the transformed inline element