aboutsummaryrefslogtreecommitdiff
path: root/test/lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/lua')
-rw-r--r--test/lua/hello-world-doc.lua10
-rw-r--r--test/lua/plain-to-para.lua6
-rw-r--r--test/lua/strmacro.lua10
3 files changed, 26 insertions, 0 deletions
diff --git a/test/lua/hello-world-doc.lua b/test/lua/hello-world-doc.lua
new file mode 100644
index 000000000..221321a60
--- /dev/null
+++ b/test/lua/hello-world-doc.lua
@@ -0,0 +1,10 @@
+return {
+ {
+ Doc = function(doc)
+ local meta = {}
+ local hello = { pandoc.Str "Hello,", pandoc.Space(), pandoc.Str "World!" }
+ local blocks = { pandoc.Para(hello) }
+ return pandoc.Doc(blocks, meta)
+ end
+ }
+}
diff --git a/test/lua/plain-to-para.lua b/test/lua/plain-to-para.lua
new file mode 100644
index 000000000..747257411
--- /dev/null
+++ b/test/lua/plain-to-para.lua
@@ -0,0 +1,6 @@
+return {
+ { Plain = function (blk)
+ return pandoc.Para(blk.c)
+ end,
+ }
+}
diff --git a/test/lua/strmacro.lua b/test/lua/strmacro.lua
new file mode 100644
index 000000000..1b28801be
--- /dev/null
+++ b/test/lua/strmacro.lua
@@ -0,0 +1,10 @@
+return {
+ { Str = function (inline)
+ if inline.c == "{{helloworld}}" then
+ return pandoc.Emph {pandoc.Str "Hello, World"}
+ else
+ return inline
+ end
+ end,
+ }
+}