script pour gérer les exercices

This commit is contained in:
julienfastre committed 2023-09-19 08:49:00 +02:00
1 parent 5469373800
commit e6408fe35a
2 files changed
+25 -1

No files matched your search

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