Skip to content

build(docs): replace vitepress-plugin-mermaid with vitepress-mermaid-viewer - #923

Merged
ddeboer merged 1 commit into
mainfrom
build/vitepress-mermaid-viewer
Oct 21, 2026
Merged

ddeboer merged 1 commit into
mainfrom
build/vitepress-mermaid-viewer

Conversation

@ddeboer

@ddeboer ddeboer commented Oct 17, 2026

Copy link
Copy Markdown
Member

The docs site renders its Mermaid diagrams with vitepress-plugin-mermaid. That plugin hasn’t had a release since September 2024 and only accepts mermaid 10 or 11 as a peer. To land the mermaid 12 bump in #891 we added an npm override, which this PR removes along with the plugin.

vitepress-mermaid-viewer replaces it:

  • Same setup: it has the same withMermaid() wrapper and mermaid config key, so look: 'handDrawn' and the per-diagram %%{init}%% settings stay as they are.
  • Open-ended peer: it accepts mermaid >=10, so future mermaid majors won’t need an override.
  • Fullscreen viewer: clicking a diagram opens it fullscreen with zoom, pan, and SVG/PNG download. This helps most with the architecture diagram, which is too wide for the column.

The viewer renders diagrams in a centered flex container. Without a CSS fix, the architecture diagram (useMaxWidth: false) shrank to the column width but kept its full height, which made its text unreadable. custom.css now stops the SVG from shrinking and uses justify-content: safe center so all of it can be scrolled to. It also replaces the old div:has(> svg) selector, which matched the previous plugin’s markup.

I checked the built site in a browser: the three diagrams (architecture, core concepts, docgen) render in light and dark mode, and the fullscreen viewer opens and zooms.

package-lock.json changes only for the plugin swap. It leaves out the unrelated workspace version drift that npm install currently adds.

…viewer

- vitepress-plugin-mermaid is dormant and caps its mermaid peer at 11, which needed an npm
  override to run mermaid 12; drop both
- vitepress-mermaid-viewer takes the same withMermaid() config, accepts mermaid >=10 and adds a
  zoomable fullscreen viewer
- Keep wide diagrams (useMaxWidth: false) at natural size: stop the viewer's flex container from
  shrinking them and keep their left edge within scroll reach
@ddeboer
ddeboer merged commit a55119e into main Oct 21, 2026
4 checks passed
@ddeboer
ddeboer deleted the build/vitepress-mermaid-viewer branch October 21, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant