summaryrefslogtreecommitdiff
path: root/data/pandoc.lua
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2017-12-01 17:58:12 +0100
committerAlbert Krewinkel <albert@zeitkraut.de>2017-12-01 17:58:12 +0100
commit6640506ddc0ab848824d818a363c2e685b8b31a5 (patch)
tree75c7cc09e5f2d7a835dcdb10c0f48e1ae66b8fee /data/pandoc.lua
parent5026dfaedf4a8043fd1d76c1b7da8880770f9255 (diff)
Lua/StackInstances: push Pandoc and Meta via constructor
Pandoc and Meta elements are now pushed by calling the respective constructor functions of the pandoc Lua module. This makes serialization consistent with the way blocks and inlines are pushed to lua and allows to use List methods with the `blocks` value.
Diffstat (limited to 'data/pandoc.lua')
-rw-r--r--data/pandoc.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/data/pandoc.lua b/data/pandoc.lua
index 74263b1fd..d8f7adb97 100644
--- a/data/pandoc.lua
+++ b/data/pandoc.lua
@@ -153,6 +153,21 @@ end
M.Doc = M.Pandoc
------------------------------------------------------------------------
+-- Meta
+-- @section Meta
+
+--- Create a new Meta object. It sets the metatable of the given table to
+--- `Meta`.
+-- @function Meta
+-- @tparam meta table table containing document meta information
+M.Meta = {}
+M.Meta.__call = function(t, meta)
+ return setmetatable(meta, self)
+end
+setmetatable(M.Meta, M.Meta)
+
+
+------------------------------------------------------------------------
-- MetaValue
-- @section MetaValue
M.MetaValue = Element:make_subtype{}