aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAlbert Krewinkel <[email protected]>2022-10-12 11:03:42 +0200
committerJohn MacFarlane <[email protected]>2022-10-12 10:16:01 -0700
commit14c7b5db20e8864f745cc95fb71c08befe49da0c (patch)
tree388ab3ef48d0aace93117379dd8571cb7ca3e478 /doc
parent253d2e768a43c8ab3ad8e1c46b2bc4a02acec946 (diff)
Lua: add function `pandoc.template.meta_to_context`.
The functions converts Meta values to template contexts; the intended use is in combination with `pandoc.template.apply`.
Diffstat (limited to 'doc')
-rw-r--r--doc/lua-filters.md23
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/lua-filters.md b/doc/lua-filters.md
index 362756404..0c88433ae 100644
--- a/doc/lua-filters.md
+++ b/doc/lua-filters.md
@@ -5238,6 +5238,29 @@ Returns:
- raw template (string)
+### meta_to_context {#pandoc.template.meta_to_context}
+
+`meta_to_context (meta, blocks_writer, inlines_writer)`
+
+Creates template context from the document's [Meta]{#type-meta}
+data, using the given functions to convert [Blocks] and [Inlines]
+to [Doc] values.
+
+Parameters:
+
+`meta`
+: document metadata ([Meta])
+
+`blocks_writer`
+: converter from [Blocks] to [Doc] values (function)
+
+`inlines_writer`
+: converter from [Inlines] to [Doc] values (function)
+
+Returns:
+
+- template context (table)
+
# Module pandoc.types
Constructors for types which are not part of the pandoc AST.