pandoc-cl/exercice-only.lua

21 lines
444 B
Lua

function Pandoc(doc)
local hblocks = {}
for i,el in pairs(doc.blocks) do
if (el.t == "Div" and el.classes:includes("exercice", 1))
then
if (el.attributes['title'] ~= nil)
then
table.insert(hblocks, pandoc.Header(1, pandoc.Inlines(el.attributes['title'])))
end
table.insert(hblocks, el)
end
end
return pandoc.Pandoc(hblocks, doc.meta)
end
return {
{ Pandoc = Pandoc },
}