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
+17
View File
@@ -0,0 +1,17 @@
-- file: remove-declared-by.lua
function Para(elem)
-- Check if the first element of the paragraph is Emph (italic)
if #elem.content >= 1 and elem.content[1].t == "Emph" then
-- Convert the first element to plain text to check its content
local firstText = pandoc.utils.stringify(elem.content[1])
-- Check if the text starts with "Declared by:"
if firstText:find("^Declared by:") then
-- Return an empty block to remove this paragraph
return {}
end
end
-- Otherwise, return the paragraph unmodified
return elem
end