ID |
|
|---|---|
Status |
Backlog |
Bucket |
tech-debt |
Theme |
docs |
Created |
2026-06-17 |
Updated |
2026-06-17 |
Render Mermaid diagrams on the published docs site
R316’s "model at a glance" section uses a Mermaid classDiagram. It renders on GitHub (where
roadmap specs are actually read) but not on the AsciiDoctor docs site at graphitron.sikt.no,
where it currently shows as a code listing. Future model specs will lean on diagrams; we want
them rendered on the site too.
The gap
The docs pipeline is: roadmap .md to .adoc via roadmap-tool
(no.sikt.graphitron.roadmap.Main render-adoc, the mdBodyToAdoc method), then
asciidoctor-maven-plugin (process-asciidoc) to HTML. In Main.mdBodyToAdoc (around line 737)
a fenced mermaid block is converted to [source,mermaid] plus a ---- listing block, which
AsciiDoctor renders as rouge-highlighted text. There is no asciidoctorj-diagram dependency and
no diagram backend.
What it requires
-
roadmap-tool (small): in
Main.mdBodyToAdoc, special-case diagram languages (mermaid, possiblyplantuml) to emit an asciidoctor-diagram block ([mermaid]+ delimited block) rather than[source,<lang>]. Add a unit test asserting the emitted adoc. -
docs/pom.xml (small): add
asciidoctorj-diagramto theasciidoctor-maven-plugindependencies and register it (<requires>asciidoctor-diagram</requires>or the attribute equivalent). -
A rendering backend (the real cost, and the decision): asciidoctor-diagram’s mermaid backend shells out to
mmdc(mermaid-cli), needing Node + a headless Chromium in thedocs-buildandpreview-docsCI jobs (.github/workflows/rewrite-build.yml,.github/workflows/preview-docs.yml); or adoptasciidoctor-krokiagainst a Kroki server (externalkroki.io, subject to the network policy, or self-hosted, which the web sandbox cannot run since it has no Docker). Pick the backend that fits CI + the network policy and document the trade.
Constraints / risks
-
CI infra across two workflow jobs; both
docs-build(trunk) andpreview-docs(PR) must get the backend or diagrams break in one of them. -
Web sandbox has no Docker (per CLAUDE.md), so a self-hosted Kroki is not runnable locally; mermaid-cli pulls a heavy Chromium.
-
External
kroki.iomay be blocked by the environment network policy.
Acceptance
-
The R316 "model at a glance"
classDiagramrenders as inline SVG on the generated site (the roadmap plan page), and bothdocs-buildandpreview-docsstay green.
Out of scope
-
GitHub rendering already works (no change needed there).
-
Converting existing prose / ASCII diagrams to Mermaid.