Mermaid Diagrams

Render Mermaid diagrams in your Markdown files

Write diagrams in standard Mermaid syntax inside fenced code blocks. MacMD Viewer renders them inline. No plugins, no config.

Diagram Types

Six diagram types, all supported

Flowchart

Visualize processes and decision trees with directional graphs.

```mermaid
graph TD
    A[Start] --> B{Decision}
    B -->|Yes| C[Action 1]
    B -->|No| D[Action 2]
    C --> E[End]
    D --> E
```

Sequence Diagram

Show interactions between components over time.

```mermaid
sequenceDiagram
    Client->>Server: HTTP Request
    Server->>Database: Query
    Database-->>Server: Results
    Server-->>Client: JSON Response
```

State Diagram

Model state machines and transitions.

```mermaid
stateDiagram-v2
    [*] --> Idle
    Idle --> Loading: fetch()
    Loading --> Success: 200 OK
    Loading --> Error: 4xx/5xx
    Error --> Idle: retry()
    Success --> [*]
```

Gantt Chart

Plan project timelines and task dependencies.

```mermaid
gantt
    title Project Plan
    section Design
    Wireframes    :a1, 2024-01-01, 7d
    Mockups       :a2, after a1, 5d
    section Dev
    Frontend      :b1, after a2, 14d
    Backend       :b2, after a2, 10d
```

Pie Chart

Display proportional data in a circular chart.

```mermaid
pie title Languages Used
    "Swift" : 45
    "TypeScript" : 30
    "Python" : 15
    "Other" : 10
```

Class Diagram

Document object-oriented structures and relationships.

```mermaid
classDiagram
    class Document {
        +String title
        +String content
        +render() HTML
    }
    class Renderer {
        +parse(md) AST
        +toHTML(ast) HTML
    }
    Document --> Renderer
```
How It Works

Just write Mermaid, we handle the rest

Use a standard fenced code block with the mermaid language tag. MacMD Viewer detects it automatically and renders the diagram inline. No configuration files, no setup, no extensions to install.

Diagrams are just the start

Syntax highlighting, QuickLook, live reload, and more.

See all featuresBuy MacMD Viewer