Skip to content

docs: start the left sidebar with every group collapsed - #915

Merged
ocots merged 1 commit into
mainfrom
docs/sidebar-collapsed
Aug 31, 2026
Merged

ocots merged 1 commit into
mainfrom
docs/sidebar-collapsed

Conversation

@ocots

@ocots ocots commented Aug 31, 2026

Copy link
Copy Markdown
Member

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: false on each sidebar group
(vitepress_config.jl's pagelist2str for a nested name => children entry) and exposes
no MarkdownVitepress option to change it.

Change

docs/make.jl overrides that one method (@eval DocumenterVitepress function pagelist2str( doc, ::Pair{<:AbstractString,<:AbstractArray}, sidenav::Val)) to emit collapsed: true
for 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) DocumenterVitepress
workaround in the same file.

Verification

Full docs build (julia --project=. docs/make.jl) — exit 0, no failed to run. The
generated docs/build/.documenter/.vitepress/config.mts now carries collapsed: true on
all 8 groups (was false on all 8). Add the run documentation label 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 for
a sidebar_collapsed kwarg on MarkdownVitepress.

🤖 Generated with Claude Code

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>
@ocots ocots added the run documentation Trigger the Documentation workflow on this PR label Aug 31, 2026
@ocots
ocots merged commit 481712a into main Aug 31, 2026
8 checks passed
@ocots
ocots deleted the docs/sidebar-collapsed branch August 31, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run documentation Trigger the Documentation workflow on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant