Render book diagrams with mermaid #17

Merged
nessar merged 1 commits from worktree-mermaid-diagrams into main 2026-10-28 20:09:32 +01:00
Owner

What

  • Add the mdbook-mermaid preprocessor: book/book.toml, book/mermaid-init.js, book/mermaid.min.js (2.7 MB). The init script follows the mdBook theme, so navy gets the dark Mermaid theme.
  • Convert the 15 ASCII diagrams of the book to Mermaid (ch01 VPC, ch02 policy evaluation, ch04, ch05, ch06, ch09, ch10 ×2, ch11 ×2, ch12 Cognito sequence, ch13 envelope encryption, ch17, ch19, ch21 trace tree).
  • Formulas, ARNs, policy snippets, Logs Insights queries and X-Ray filter expressions stay as text blocks: they are not diagrams.

Notes

  • Needs mdbook-mermaid 0.14.0: cargo install mdbook-mermaid --version 0.14.0. The latest (0.17.x) targets mdBook 0.5 and fails with mdBook 0.4.37.
  • Every build prints a harmless warning: "preprocessor built against mdbook 0.4.52, called from 0.4.37".
  • Mermaid quirks handled: labels starting with 1. render as "Unsupported markdown: list" (written Step 1:), and two-line subgraph titles overlap their nodes (kept to one line).

Checked

  • All 15 blocks parse and render in headless Chrome, and I reviewed the rendered output.
  • mdbook build book passes.

🤖 Generated with Claude Code

## What - Add the `mdbook-mermaid` preprocessor: `book/book.toml`, `book/mermaid-init.js`, `book/mermaid.min.js` (2.7 MB). The init script follows the mdBook theme, so `navy` gets the dark Mermaid theme. - Convert the 15 ASCII diagrams of the book to Mermaid (ch01 VPC, ch02 policy evaluation, ch04, ch05, ch06, ch09, ch10 ×2, ch11 ×2, ch12 Cognito sequence, ch13 envelope encryption, ch17, ch19, ch21 trace tree). - Formulas, ARNs, policy snippets, Logs Insights queries and X-Ray filter expressions stay as text blocks: they are not diagrams. ## Notes - Needs `mdbook-mermaid` **0.14.0**: `cargo install mdbook-mermaid --version 0.14.0`. The latest (0.17.x) targets mdBook 0.5 and fails with mdBook 0.4.37. - Every build prints a harmless warning: "preprocessor built against mdbook 0.4.52, called from 0.4.37". - Mermaid quirks handled: labels starting with `1.` render as "Unsupported markdown: list" (written `Step 1:`), and two-line subgraph titles overlap their nodes (kept to one line). ## Checked - All 15 blocks parse and render in headless Chrome, and I reviewed the rendered output. - `mdbook build book` passes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
nessar added 1 commit 2026-10-28 20:09:06 +01:00
Add the mdbook-mermaid preprocessor (0.14.0, compatible with mdbook 0.4.x)
and convert the 15 ASCII diagrams in ch01, ch02, ch04, ch05, ch06, ch09,
ch10, ch11, ch12, ch13, ch17, ch19 and ch21 to mermaid blocks. Formulas,
ARNs, policies and query snippets stay as text.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
nessar merged commit 7500a2ef73 into main 2026-10-28 20:09:32 +01:00
nessar deleted branch worktree-mermaid-diagrams 2026-10-28 20:09:34 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nessar/awslings#17