From a43ca52aa2d102c7499c7fd8478304a26ea2cd0a Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sat, 18 Jun 2022 15:51:18 +0200 Subject: Improved Lua filters, improved exhibit pages --- filters/lib/common.lua | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 filters/lib/common.lua (limited to 'filters/lib/common.lua') diff --git a/filters/lib/common.lua b/filters/lib/common.lua new file mode 100644 index 0000000..7654eb9 --- /dev/null +++ b/filters/lib/common.lua @@ -0,0 +1,30 @@ +function wide(el) + local els = pandoc.List() + + els:insert(pandoc.RawBlock("html", "")) + if pcall(function() return #el end) then + els:extend(el) + else + els:insert(el) + end + els:insert(pandoc.RawBlock("html", "
")) + + return els +end + +function dump(o) + if type(o) == 'table' then + local s = '{ ' + for k, v in pairs(o) do + if type(k) ~= 'number' then k = '"' .. k .. '"' end + s = s .. '[' .. k .. '] = ' .. dump(v) .. ',' + end + return s .. '} ' + else + return tostring(o) + end +end + +return { + wide = wide +} -- cgit v1.2.3-54-g00ecf