Extensions · Chapter 15
Diagrams with Mermaid
Mermaid is a small language for diagrams. You describe what connects to what, and nexlore draws it for you. In the file the diagram stays text, so you can search it and read it in any editor.
Drawing a process
How you write it
```mermaid
flowchart LR
A[Starter] --> B[Dough]
B --> C{Proofed?}
C -->|yes| D[Bake]
C -->|no| B
```How it looks
You write arrows as -->. Square brackets make boxes, curly brackets make a diamond for questions, and |yes| puts a label on an arrow.
Which other diagrams Mermaid draws
| First line | Diagram |
|---|---|
flowchart TD | a flowchart from top to bottom (LR: from left to right) |
sequenceDiagram | who sends what to whom, and when |
gantt | a schedule with bars |
timeline | a timeline |
pie | a pie chart |
mindmap | a mind map |
Lore saysIn the editor the diagram sits right below its code. If a diagram can't be drawn, nexlore shows its text and tells you that it didn't work. nexlore never runs links or scripts in diagrams.