feat(wiki): enhanced table of contents — collapsible, numbered, floating #673
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Enhance the existing wiki table of contents with collapsible sections, optional numbering, scroll-tracking, and per-page control via frontmatter.
Current State
WikiSidebarTocHTMLis generated fromrctx.TocHeadingItemsinrenderViewPage()and rendered in the sidebarProposed Enhancements
1. Collapsible Sections
localStorageper page2. Section Numbering
1,1.1,1.2.1toc_numbered: true3. Floating/Sticky ToC
position: stickywithIntersectionObserverfor heading tracking4. Per-Page Control via Frontmatter
Files to Modify
routers/web/repo/wiki.gotemplates/repo/wiki/view.tmplweb_src/js/features/repo-wiki.tsweb_src/css/Wikipedia Parity
Wikipedia's ToC is auto-generated, numbered, and collapsible — a key navigation aid on long articles.