Skip to content

feat(html): add fold.headers for sidebar header nav#3121

Open
leno23 wants to merge 1 commit into
rust-lang:masterfrom
leno23:feat/fold-sidebar-headers-3054
Open

feat(html): add fold.headers for sidebar header nav#3121
leno23 wants to merge 1 commit into
rust-lang:masterfrom
leno23:feat/fold-sidebar-headers-3054

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 17, 2026

Summary

  • Adds output.html.fold.headers (default false) to control folding of the page header list shown by sidebar-header-nav.
  • When headers = true and enable = true, header items use the same level semantics as chapter folding.
  • Extends the heading-nav-folded GUI test book to verify nested headers start collapsed.

Fixes #3054

Test plan

  • cargo test -p mdbook-core
  • GUI: heading-nav-folded.goml (requires browser-ui-test in CI)

Made with Cursor

@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label May 17, 2026
When output.html.fold.headers is true and folding is enabled, apply the
same fold level settings to the on-page header list in the sidebar.
@leno23 leno23 force-pushed the feat/fold-sidebar-headers-3054 branch from fe2bb04 to 8d2c83d Compare May 17, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: waiting on a review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Collapse/fold sidebar-header-nav

2 participants