dad2b237d480ba64706fbb6c63d092b2738a2413 jnavarr5 Mon Aug 24 15:33:38 2026 -0700 Add ### headings as indented TOC sub-items and fix docs sidebar highlighting, refs #36320 diff --git docs/staticPage.lua docs/staticPage.lua index 31aba84f10c..d6ff5208871 100644 --- docs/staticPage.lua +++ docs/staticPage.lua @@ -131,31 +131,32 @@ add("") add("/style/bootstrap-3-3-7.min.css\">") add("") add("

" .. metadata["title"] .. "

") else add("

No title defined in document, first line must be % mytitle

") end -- Sidebar TOC + body in Bootstrap grid. The docs-page class scopes -- /docs/-only typography and table styling in gbStatic.css. add('
') add('') add('
') -- ucsc change end add(body) add('
') -- close col-md-10 add('
') -- close row if #notes > 0 then add('
    ') for _,note in pairs(notes) do add(note) end @@ -300,39 +301,45 @@ return s end function Para(s) return "

    \n" .. s .. "\n

    " end -- lev is an integer, the header level. function Header(lev, s, attr) local lines = { } if lev == 1 then idStr = simplifyId(s) - table.insert(headers, {text = s, id = idStr}) + table.insert(headers, {text = s, id = idStr, sub = false}) table.insert(lines, "

    " .. s .. "

    ") headerOpen = true elseif lev == 2 then -- Collect lev==2 headers for TOC (markdown ## headings) local idStr = attr.id or simplifyId(s) - table.insert(headers, {text = s, id = idStr}) + table.insert(headers, {text = s, id = idStr, sub = false}) + table.insert(lines, "" .. s .. "") + + elseif lev == 3 then + -- Collect lev==3 headers for TOC as indented sub-items (markdown ### headings) + local idStr = attr.id or simplifyId(s) + table.insert(headers, {text = s, id = idStr, sub = true}) table.insert(lines, "" .. s .. "") else table.insert(lines, "" .. s .. "") end return table.concat(lines, "\n") end function BlockQuote(s) return "
    \n" .. s .. "\n
    " end function HorizontalRule() return "
    "