aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAlbert Krewinkel <[email protected]>2022-10-11 21:40:21 +0200
committerJohn MacFarlane <[email protected]>2022-10-11 14:03:08 -0700
commit78d7fc46febe3f2d5ebc1bea4761d115bb26f117 (patch)
treeffb4bccbdc58ee339cfdd44879b8fb153f4dc3a1 /doc
parent3cac33bdd2b2b69ac585cc37498deea49763c665 (diff)
Lua: add function `pandoc.template.apply`
The new function applies a context, containing variable assignments, to a template.
Diffstat (limited to 'doc')
-rw-r--r--doc/lua-filters.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/doc/lua-filters.md b/doc/lua-filters.md
index 15097abcb..362756404 100644
--- a/doc/lua-filters.md
+++ b/doc/lua-filters.md
@@ -5171,6 +5171,28 @@ Returns
Handle pandoc templates.
+### apply {#pandoc.template.apply}
+
+`apply (template, context)`
+
+Applies a context with variable assignments to a template,
+returning the rendered template. The `context` parameter must be a
+table with variable names as keys and [Doc], string, boolean, or
+table as values, where the table can be either be a list of the
+aforementioned types, or a nested context.
+
+Parameters:
+
+`template`
+: template to apply ([Template]{#type-template})
+
+`context`
+: variable values (table)
+
+Returns:
+
+- rendered template ([Doc])
+
### compile {#pandoc.template.compile}
`compile (template[, templates_path])`