aboutsummaryrefslogtreecommitdiff
path: root/doc/lua-filters.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/lua-filters.md')
-rw-r--r--doc/lua-filters.md33
1 files changed, 33 insertions, 0 deletions
diff --git a/doc/lua-filters.md b/doc/lua-filters.md
index dfd92a35b..6f03360bb 100644
--- a/doc/lua-filters.md
+++ b/doc/lua-filters.md
@@ -1172,6 +1172,8 @@ Lua functions for pandoc scripts.
Returns: strong element
+## Element components
+
[`Attr ([identifier[, classes[, attributes]]])`]{#Attr}
: Create a new set of attributes (Attr).
@@ -1431,6 +1433,37 @@ functions.
print(table.concat(elements[1].numbering, '.')) -- 0.1
print(table.concat(elements[2].numbering, '.')) -- 0.2
+[`run_json_filter (doc, filter[, args])`]{#utils-run_json_filter}
+
+: Filter the given doc by passing it through the a JSON filter.
+
+ Parameters:
+
+ `doc`:
+ : the Pandoc document to filter
+
+ `filter`:
+ : filter to run
+
+ `args`:
+ : list of arguments passed to the filter. Defaults to
+ `{FORMAT}`.
+
+ Returns:
+
+ - ([Pandoc](#Pandoc)) Filtered document
+
+ Usage:
+
+ -- Assumes `some_blocks` contains blocks for which a
+ -- separate literature section is required.
+ local sub_doc = pandoc.Pandoc(some_blocks, metadata)
+ sub_doc_with_bib = pandoc.utils.run_json_filter(
+ sub_doc,
+ 'pandoc-citeproc'
+ )
+ some_blocks = sub_doc.blocks -- some blocks with bib
+
[`normalize_date (date_string)`]{#utils-normalize_date}
: Parse a date and convert (if possible) to "YYYY-MM-DD"