Skip to content

Commit 5d70872

Browse files
committed
docs(mermaid): enable native Mermaid.js rendering via superfences fence
```mermaid fences (README architecture/update-flow/directory diagrams) were emitted as plain code blocks because mkdocs.yml had no Mermaid integration. Add the pymdownx.superfences custom fence (class=mermaid) documented by Material for MkDocs — the theme then lazy-loads mermaid@11 and renders the diagrams client-side, theme-aware (light/dark). Note: rendering needs internet at view time (theme loads mermaid from unpkg CDN); without it the raw source shows as fallback. Also pin mkdocs-material==9.7.7 in the publish workflow and DOCS.md (reproducible builds; 9.7.7 is the latest release, project is in maintenance mode until 2026-11-05).
1 parent 2a874f7 commit 5d70872

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

.github/workflows/docs-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
fi
7777
7878
- name: Install docs tooling
79-
run: python3 -m pip install --quiet mkdocs-material mike
79+
run: python3 -m pip install --quiet "mkdocs-material==9.7.7" mike
8080

8181
- name: Prepare docs tree + version stamp
8282
run: python3 scripts/generate.py ${TAG:+--tag "$TAG"}

DOCS.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ This branch carries the documentation site for the LocalPibox stack
99
- **`docs/` is derived** (gitignored) — `scripts/generate.py` copies the
1010
tracked content and stamps version pages (repo map, versions) from the
1111
6 stack repos. Run it before every build; CI does this automatically.
12+
- **Mermaid diagrams** (` ```mermaid ` fences, e.g. in `README.md`) are
13+
rendered client-side by the Material theme, which lazy-loads mermaid@11
14+
from the unpkg CDN on first visit — viewing diagrams needs internet
15+
access; without it the raw source shows as a code block (fallback).
1216
- **Versions** are cut by `.github/workflows/docs-publish.yml`:
1317
- push to `docs` → living `edge` version (always newest content)
1418
- dispatch with `tag: 0.0.X-lpb[-dev]` → immutable per-tag version + alias
@@ -19,7 +23,7 @@ This branch carries the documentation site for the LocalPibox stack
1923
## Local build
2024

2125
```bash
22-
python3 -m pip install --user mkdocs-material mike
26+
python3 -m pip install --user "mkdocs-material==9.7.7" mike
2327
python3 scripts/generate.py # or: --tag 0.0.53-lpb-dev
2428
mike serve # live preview at http://localhost:8000
2529
```

mkdocs.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ markdown_extensions:
5050
- admonition
5151
- attr_list
5252
- md_in_html
53+
# Mermaid.js diagrams: theme renders ```mermaid fences client-side
54+
# (lazy-loads mermaid@11 from CDN when a .mermaid block is present)
55+
- pymdownx.superfences:
56+
custom_fences:
57+
- name: mermaid
58+
class: mermaid
59+
format: !!python/name:pymdownx.superfences.fence_code_format
5360

5461
nav:
5562
- Home: index.md

0 commit comments

Comments
 (0)