summaryrefslogtreecommitdiff
path: root/repo/www/print-title.lua
diff options
context:
space:
mode:
Diffstat (limited to 'repo/www/print-title.lua')
-rw-r--r--repo/www/print-title.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/repo/www/print-title.lua b/repo/www/print-title.lua
new file mode 100644
index 0000000..c2c90fb
--- /dev/null
+++ b/repo/www/print-title.lua
@@ -0,0 +1,26 @@
+title = ''
+
+titlefilter = {
+ Str = function (element)
+ title = title .. element.text
+ end,
+
+ Code = function (element)
+ title = title .. element.text
+ end,
+
+ Space = function (element)
+ title = title .. ' '
+ end,
+}
+
+function Pandoc(doc)
+ pandoc.List.map(
+ doc.meta.title,
+ function (inline)
+ pandoc.walk_inline(pandoc.Span(inline), titlefilter)
+ end
+ )
+ print(title)
+ os.exit(0)
+end