Repository navigation
Diagrams
(since 5.1) A ```mermaid block is drawn as its diagram: laid out by RayoMD and drawn as
vector graphics in the document's font, with no browser, Node.js or Mermaid CLI. It works in
the standard and the Unicode renderer, in quotes and list items, in PDF/A-3b and PDF/UA-1 (a
figure whose alternate text is the diagram's source), and in the desktop app's preview.
```mermaid
flowchart LR
A[Write Markdown] --> B{Diagrams?}
B -->|yes| C[Drawn natively]
B -->|no| D[Code block]
```| Type | Supported |
|---|---|
Flowcharts (flowchart, graph) |
TB/TD/BT/LR/RL; the 12 classic shapes; every link type (-->, ---, -.->, ==>, --x, --o, <-->, ~~~, longer links); labels -- text --> and -->|text|; chains and &; quoted labels and <br>; subgraph … end (nested, with direction); classDef, class, ::: and style for fill, stroke, stroke width, text colour and dashes; %% comments |
| Sequence diagrams | participants and actors with aliases; the eight arrow types; messages to oneself; activations (activate, +/-); notes left of, right of and over; loop, alt/else, opt, par/and, critical/option, break and rect frames; autonumber; title
|
| Pie charts | slices with labels and values, showData, title
|
linkStyle, click, accTitle, accDescr and front matter are read and draw nothing.
Other diagram types (class, state, entity-relationship, Gantt, xychart-beta, mindmaps, …), the
newer syntax (@{ shape: … }, create, box), malformed diagrams and diagrams past the limits
(128 KiB of source, 1,000 nodes, 2,000 edges, 64 participants, 64 slices, among others) show
their source as a code block, exactly as before 5.1. --no-diagrams (PdfOptions::diagrams = false; Mermaid diagrams in the desktop app's options) shows every block that way.
Colours follow Mermaid's default theme; a Themes's accent-color colours the node
borders and the first pie slice. The layout is RayoMD's own (a layered layout for flowcharts,
lanes and rows for sequence diagrams), close to Mermaid's but not identical: long edges in dense
graphs can pass near nodes, and an edge leaving a subgraph can cross its title.
The complete contract, with every limit, is
docs/development/native_mermaid.md.