csl-clio/Utilitaires/changelog-dans-annexes.lua

21 lines
514 B
Lua
Raw Normal View History

local CHANGELOG_PATH = '../CHANGELOG.md'
local ANNEXES_HEADER_LEVEL = 1
local shift_headings = {
Header = function(header)
header.level = header.level + ANNEXES_HEADER_LEVEL
return header
end
}
function Div (div)
if div.classes:includes('changelog', 1) then
local changelog = io.open(CHANGELOG_PATH):read('a')
local changelog_doc = pandoc.read(changelog)
local to_include = pandoc.walk_block(pandoc.Div(changelog_doc.blocks), shift_headings).content
return to_include
end
end