Skip to content
Documentation

Mermaid Diagrams

updated

This is a level-3 document — the deepest nesting Meldoc allows. It lives under Writing in Markdown, which is under How Meldoc Works.

Meldoc renders Mermaid diagrams directly in your documents. Just use a fenced code block with the mermaid language tag.

Flowchart

A simple documentation workflow:

flowchart LR
    Write[Write content] --> Organize[Organize hierarchy]
    Organize --> Review[Review & refine]
    Review --> Publish[Publish]
    Publish --> Share[Share with your team]

Sequence diagram

How the CLI syncs your local files with the Meldoc server:

sequenceDiagram
    participant Local as Your Computer
    participant Server as Meldoc Server
    Local->>Server: meldoc push (upload changes)
    Server-->>Local: Confirmation
    Server->>Local: meldoc pull (download updates)
    Local-->>Server: Acknowledgment

Pie chart

A totally scientific breakdown:

pie title Time spent on documentation
    "Writing" : 40
    "Organizing" : 25
    "Formatting" : 15
    "Admiring your work" : 20

Syntax

To create a diagram, wrap your Mermaid code in a fenced block:

```mermaid
flowchart LR
    A --> B --> C
```

Meldoc supports flowcharts, sequence diagrams, state diagrams, ER diagrams, Gantt charts, pie charts, and mindmaps. See the Mermaid documentation for the full syntax reference.