Gros refactoring

This commit is contained in:
François Pelletier 2024-12-31 17:00:07 -05:00
parent 6008aa68f6
commit 4a6bfc951f
368 changed files with 22503 additions and 3 deletions

29
backend/centered.lua Normal file
View file

@ -0,0 +1,29 @@
-- centered.lua
-- Copyright (c) bpj on GitHub
-- https://github.com/jgm/pandoc/issues/719#issuecomment-922019826
-- GPL-2+ license
local center_for = {
latex = {
pre = pandoc.RawBlock('latex', '\\begin{center}'),
post = pandoc.RawBlock('latex', '\\end{center}'),
},
-- add more as needed...
}
function Div (div)
if div.classes:includes('center') then
if center_for[FORMAT] then
local rv = {}
if center_for[FORMAT].pre then
rv[#rv+1] = center_for[FORMAT].pre
end
rv[#rv+1] = div
if center_for[FORMAT].post then
rv[#rv+1] = center_for[FORMAT].post
end
return rv
end
end
return nil
end