Improved documentation generation, no more hacky sed/awk!

This commit is contained in:
rasmus-kirk
2024-02-28 12:16:25 +01:00
parent c5397fb4df
commit 906a8c3a50
9 changed files with 181 additions and 38 deletions
+14
View File
@@ -0,0 +1,14 @@
-- Adds anchor links to headings with IDs.
function Header (h)
if h.identifier ~= '' then
-- an empty link to this header
local anchor_link = pandoc.Link(
{}, -- content
'#' .. h.identifier, -- href
'', -- title
{class = 'anchor', ['aria-hidden'] = 'true'} -- attributes
)
h.content:insert(1, anchor_link)
return h
end
end