This commit is contained in:
Justin Lin
2025-11-06 16:57:12 +11:00
commit 48cc11ba3e
48 changed files with 2758 additions and 0 deletions

18
demote-nonpart.lua Normal file
View File

@@ -0,0 +1,18 @@
-- If a file has front matter `part: true`, keep its headings as-is.
-- Otherwise, demote all headings by one level: # -> ##, ## -> ###, etc.
local is_part_doc = false
function Meta(m)
print(m)
if m.part == true then
is_part_doc = true
end
end
function Header(h)
if not is_part_doc then
h.level = math.min(h.level + 1, 6)
end
return h
end