Skip to content

ReferenceWriting these docs

Adding a diagram

1 min readUpdated

Page actions

ChatGPT and Claude are third-party services. The link gives them this page's public address and a short instruction. This site records nothing.

Mermaid in a page: the brand palette, the accessible title and description every diagram needs, what renders on GitHub and on the site, and when a poster is the better tool.

A Mermaid fence renders on GitHub with GitHub’s theme and on the site as accessible inline SVG in the brand palette, at build time — no runtime JavaScript, indexed by search, readable by a screen reader.

The rules

  • Start every diagram with accTitle: (a name) and accDescr: (one sentence). The gate warns on a missing title.
  • Colours, if you set any, come from docs/brand/tokens.json; no %%{init} directives — the theme is central. Brand red never appears in a diagram.
  • Labels are plain text (htmlLabels is off): use <br/> for a line break, nothing else.
  • No scripture in a diagram, ever.
  • Draw top to bottom (flowchart TB): the page’s column is narrow, and a wide left-to-right chart is scaled down until its text cannot be read, or scrolls sideways. Short labels; the detail goes in the prose.
  • Give it an accDescr as well as an accTitle: the description is what a screen reader says.
  • Keep it under about twelve nodes. Past that, write a poster: it steps, it zooms, and it carries a verified stamp.

Example

A pin bump reaches productionsggs-data publishes; the platform bumps its lock in a pull request; the integrity check proves the pin; a merge deploys.publishesgreen

sggs-data

dataset.lock.json bump

integrity check

merge → deploy

A pin bump reaches productionsggs-data publishes; the platform bumps its lock in a pull request; the integrity check proves the pin; a merge deploys.publishesgreen

sggs-data

dataset.lock.json bump

integrity check

merge → deploy

A pin bump reaches production

Checking it

make docs-check checks the palette and the title; make docs renders every fence and fails the build if one does not render (the check-mermaid step confirms none was left as a code block).