Skip to content

Commit 0c9d87c

Browse files
committed
🤖 feat: add mdBook-pagetoc for in-page table of contents
Added mdbook-pagetoc preprocessor to generate automatic table of contents for documentation pages. Benefits: - Improves navigation for long pages (especially API reference) - Shows page structure at a glance - Better user experience when browsing documentation Uses: https://github.com/JorelAli/mdBook-pagetoc Generated with cmux
1 parent 5e24ca0 commit 0c9d87c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,7 @@ test_hot_reload.sh
112112

113113
# TypeDoc
114114
.typedoc/
115+
116+
# mdBook pagetoc (auto-generated)
117+
docs/theme/pagetoc.css
118+
docs/theme/pagetoc.js

docs/book.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ use-default-preprocessors = true
1313
[preprocessor.mermaid]
1414
command = "mdbook-mermaid"
1515

16+
[preprocessor.pagetoc]
17+
1618
[output.html]
1719
git-repository-url = "https://github.com/coder/cmux"
1820
edit-url-template = "https://github.com/coder/cmux/edit/main/docs/{path}"
19-
additional-js = ["mermaid.min.js", "mermaid-init.js"]
20-
additional-css = ["theme/custom.css"]
21+
additional-js = ["mermaid.min.js", "mermaid-init.js", "theme/pagetoc.js"]
22+
additional-css = ["theme/custom.css", "theme/pagetoc.css"]
2123
default-theme = "navy"
2224
preferred-dark-theme = "navy"
2325
favicon = "theme/favicon.webp"

0 commit comments

Comments
 (0)