Repository navigation
docs: start the left sidebar with every group collapsed - #915
Merged
Merged
Conversation
DocumenterVitepress 0.3.5 hard-codes `collapsed: false` on every sidebar group (vitepress_config.jl's `pagelist2str`), with no MarkdownVitepress option to change it, so the whole nav tree renders fully expanded. Override that one method in make.jl to emit `collapsed: true` for the sidebar: each group starts folded and VitePress auto-expands the one containing the current page. The navbar branch is left untouched. Verified: generated .vitepress/config.mts now has `collapsed: true` on all 8 groups; full docs build clean. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The left navigation sidebar renders with every group expanded, so the reader scrolls
past the full page tree of every section to reach the one they are in.
DocumenterVitepress 0.3.5 hard-codes
collapsed: falseon each sidebar group(
vitepress_config.jl'spagelist2strfor a nestedname => childrenentry) and exposesno
MarkdownVitepressoption to change it.Change
docs/make.jloverrides that one method (@eval DocumenterVitepress function pagelist2str( doc, ::Pair{<:AbstractString,<:AbstractArray}, sidenav::Val)) to emitcollapsed: truefor the sidebar branch only — the navbar branch (
Val(:navbar)) is untouched.Result: every sidebar group starts folded; VitePress still auto-expands the group that
contains the current page, so context is not lost.
Sits next to the existing
Base.showable(::MIME"image/png", ::Plots.Plot)DocumenterVitepressworkaround in the same file.
Verification
Full docs build (
julia --project=. docs/make.jl) — exit 0, nofailed to run. Thegenerated
docs/build/.documenter/.vitepress/config.mtsnow carriescollapsed: trueonall 8 groups (was
falseon all 8). Add therun documentationlabel to preview the site.Note
This is a private-API override. If DocumenterVitepress later adds a real option (or changes
pagelist2str's signature), replace this block. Worth a short upstream feature request fora
sidebar_collapsedkwarg onMarkdownVitepress.🤖 Generated with Claude Code