script pour gérer les exercices
This commit is contained in:
20
exercice-only.lua
Normal file
20
exercice-only.lua
Normal 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 },
|
||||
}
|
Reference in New Issue
Block a user