init
This commit is contained in:
18
demote-nonpart.lua
Normal file
18
demote-nonpart.lua
Normal 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
|
||||
Reference in New Issue
Block a user