git.iko.soy/typeable/pandoc
on master help sign in
doc/lua-filter.md: document pandoc.utils.stringify

Change: minor

commitdd217f75e50fdfaf990dd2ccbd08e42230765056 authorAlbert Krewinkel <albert@zeitkraut.de> dateFri 22 Dec 2017, 20:29 (9 years ago) parent23edb95
1 file changed+27−10
doc/lua-filters.md+27−10
doc/lua-filters.md+27−10
@@ -166,15 +166,17 @@ those elements accessible through the filter function parameter.
166166
167167Some pandoc functions have been made available in lua:
168168
169−- `walk_block` and `walk_inline` allow filters to be applied
170− inside specific block or inline elements.
171−- `read` allows filters to parse strings into pandoc documents
172−- `pipe` runs an external command with input from and output to
173− strings
174−- `sha1` generates a SHA1 hash
175−- The `mediabag` module allows access to the "mediabag,"
176− which stores binary content such as images that may be
177− included in the final document.
169+- [`walk_block`](#walk_block) and [`walk_inline`](#walk_inline)
170+ allow filters to be applied inside specific block or inline
171+ elements;
172+- [`read`](#read) allows filters to parse strings into pandoc
173+ documents;
174+- [`pipe`](#pipe) runs an external command with input from and
175+ output to strings;
176+- [`sha1`](#utils-sha1) generates a SHA1 hash;
177+- the [`pandoc.mediabag`](#module-pandoc.mediabag) module allows
178+ access to the "mediabag," which stores binary content such as
179+ images that may be included in the final document.
178180
179181# Lua interpreter initialization
180182
@@ -1405,7 +1407,7 @@ Lua functions for pandoc scripts.
14051407 -- the above is equivallent to
14061408 -- return {{Str = Str}}
14071409
1408−[`pipe (command, args, input)`]{#mediabag-sha1}
1410+[`pipe (command, args, input)`]{#pipe}
14091411
14101412: Runs command with arguments, passing it some input,
14111413 and returns the output.
@@ -1442,6 +1444,21 @@ functions.
14421444
14431445 local fp = pandoc.utils.sha1("foobar")
14441446
1447+[`stringify (element)`]{#utils-stringify}
1448+
1449+: Converts the given element (Pandoc, Meta, Block, or Inline)
1450+ into a string with all formatting removed.
1451+
1452+ Returns:
1453+
1454+ - A plain string representation of the given element.
1455+
1456+ Usage:
1457+
1458+ local inline = pandoc.Emph{pandoc.Str 'Moin'}
1459+ -- outputs "Moin"
1460+ print(pandoc.utils.stringify(inline))
1461+
14451462
14461463# Module pandoc.mediabag
14471464