Skip to content

feat: add mermaid diagram rendering with interactive zoom overlay to mdbook docs#140

Open
sahitya-chandra wants to merge 2 commits intobenodiwal:mainfrom
sahitya-chandra:add-mermaid-rendering
Open

feat: add mermaid diagram rendering with interactive zoom overlay to mdbook docs#140
sahitya-chandra wants to merge 2 commits intobenodiwal:mainfrom
sahitya-chandra:add-mermaid-rendering

Conversation

@sahitya-chandra
Copy link
Copy Markdown
Contributor

@sahitya-chandra sahitya-chandra commented Apr 2, 2026

Summary

  • Added mdbook-mermaid preprocessor to render mermaid diagrams in the documentation
  • Previously, mermaid code blocks in pages like architecture.md displayed raw code instead of rendered diagrams
  • Added an interactive zoom overlay: click any diagram to open it in a modal with zoom in/out, drag-to-pan, and pinch-to-zoom support
  • Removed deprecated copy-fonts option from book.toml

Before

Screencast.from.2026-04-02.12-34-30.webm

After

Screencast.from.2026-04-02.12-42-42.webm

Files Added

  • mermaid.min.js: Mermaid library for rendering diagrams (generated by mdbook-mermaid install)
  • mermaid-init.js: Initialization script for mermaid (generated by mdbook-mermaid install)
  • mermaid-zoom.js: Custom interactive overlay with drag-to-pan, scroll/pinch zoom, and keyboard support
  • mermaid-zoom.css: Styles for the zoom overlay, adapted to mdbook theme variables

- Updated book.toml to include new CSS and JS files for mermaid zoom feature.
- Added mermaid-zoom.css for styling the zoom overlay and controls.
- Implemented mermaid-zoom.js to handle zooming and panning interactions for mermaid diagrams.
@sahitya-chandra
Copy link
Copy Markdown
Contributor Author

sahitya-chandra commented Apr 3, 2026

@benodiwal sir, can you please review this PR when you get a chance?

I left this in my #90 pr, but now I thought adding this would make it easy for someone who wants to understand the architecture

Let me know if you'd like any changes!
thanks

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