The reader should receive a picture, not a diagramming application hidden inside an article.
The source belongs to the build
PlantUML and Mermaid both let me describe a diagram as text. That source is convenient to review, revise and keep beside the article. It does not mean the source must become a code block in the article, or that a browser should run a diagram engine when someone opens the page.
This blog publishes static files. The build turns each diagram into SVG pictures in both light and dark palettes. The article refers to those pictures as image sections. Its page stylesheet shows the variant that matches the reader's selected theme, while the other variant stays hidden. The browser never parses the PlantUML or Mermaid source.
PlantUML: source to picture
The sequence diagram makes the boundary visible. The build reads the article and diagram sources, calls the renderers, and puts the SVG results in the static asset tree. The reader requests an HTML page and image files. There is no diagram server in the reading path and no source editor or live preview embedded in the article.
Syntax highlighting is a separate feature. A PEG grammar can describe PlantUML or Mermaid syntax so source snippets elsewhere are highlighted consistently. That grammar does not render diagrams, and these pictures are not code sections.
Mermaid: two pictures, one source
A transparent background is not enough to make every diagram work on both light and dark surfaces. Text, borders and fills still need contrast. Keeping two pictures lets each palette remain legible without filtering or recoloring the rendered SVG and without constraining a diagram to an awkward middle gray.
The theme-aware image section is still an ordinary picture component. It brings the stylesheet it needs, keeps both image dimensions stable, and lets the page's existing theme choice select the visible variant. Other static images can use the same pattern whenever a single palette cannot serve both themes well.
