script pour gérer les exercices

This commit is contained in:
2023-09-19 08:49:00 +02:00
parent 5469373800
commit e6408fe35a
2 changed files with 25 additions and 1 deletions

20
exercice-only.lua Normal file
View File

@@ -0,0 +1,20 @@
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 },
}