summaryrefslogtreecommitdiffstats
path: root/filters/lib/common.lua
blob: 7654eb951397adcb546d97eeb20249492e2eefba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function wide(el)
    local els = pandoc.List()

    els:insert(pandoc.RawBlock("html", "</div>"))
    if pcall(function() return #el end) then
        els:extend(el)
    else
        els:insert(el)
    end
    els:insert(pandoc.RawBlock("html", "<div class=\"l-container l-container--narrow u-ml-0\">"))

    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
}