Mermaid

Veröffentlicht: Lesedauer: 2 Min.

← Back to table of contents

10. Mermaid (Diagrams)

mrkdwn renders Mermaid diagrams (version 12.4.0) directly in the editor and in the PDF export — fast and fully offline (the Mermaid library ships with the app; no external resources are loaded).


Enabling

Turn on Settings → Editor → Mermaid.


Syntax

A diagram is written as a code block using the mermaid language:

```mermaid
flowchart TD
    A[Start] --> B{Decision}
    B -->|Yes| C[Action]
    B -->|No| D[End]
```
  • In Visual mode the diagram is rendered.
  • In Raw mode the Mermaid source is shown.
  • When converting back to Markdown the source is preserved unchanged (the rendered diagram is not “baked in”).

Supported diagram types

Mermaid supports, among others:

  • Flowcharts (flowchart / graph)
  • Sequence diagrams (sequenceDiagram)
  • Class diagrams (classDiagram)
  • State diagrams (stateDiagram-v2)
  • Entity-Relationship (erDiagram)
  • Gantt charts (gantt)
  • Pie charts (pie)
  • User journey, mindmap, timeline and more

Dark themes

In dark themes Mermaid automatically uses adapted line and label colors (light lines/labels on a dark background) so diagrams stay readable without a light background. The choice is based on the active theme’s background brightness.


PDF & print

Diagrams are also included in the PDF export and in printing. When the scientific style (see Export ) is enabled, diagrams are shown in a neutral black-and-white style.


Security

Mermaid runs in strict security mode: diagram labels are treated as text; embedded HTML or script is not executed.

← Back · Next: iPad specifics →

Letzte Anpassung: ↑ zum Anfang