Using Diagrams
To fence a Mermaid block, simply use the mermaid language identifier. Bark will automatically detect this and render it as a diagram rather than displaying it as a code listing.
This process requires no plugins or build steps. The client loads mermaid.js once per page and replaces the raw code block with the rendered SVG after the page has finished loading.
Flowchart
```mermaid
flowchart LR
A[Request hits Bark] --> B{Page in cache?}
B -->|Yes| C[Serve cached HTML]
B -->|No| D[404]
C --> E[Compute ETag]
E --> F[Return response]
```Sequence diagram
Class diagram
Useful for explaining a data model, not just code architecture:
State diagram
Pie chart
Note
Diagrams on this site render client-side after the initial page load. Consequently, they are not visible in the raw HTML source or to automated tools that only scrape text, including many search engine crawlers and text-based indexing files like sitemap.xml or llms.txt. If a diagram is essential to the reader's understanding of the content, please ensure that the core information is also provided in the surrounding text.
Note
Mermaid bakes its colors into the rendered SVG, it doesn't follow CSS variables the way the rest of the page does. Toggling dark mode on a page with diagrams triggers a full reload so they redraw with the right theme.