Skip to content
nexlore

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
StarterDoughProofed?Bakeyesno

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 lineDiagram
flowchart TDa flowchart from top to bottom (LR: from left to right)
sequenceDiagramwho sends what to whom, and when
gantta schedule with bars
timelinea timeline
piea pie chart
mindmapa 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.