Text-based diagramming tool rendered from fenced code blocks tagged mermaid. Supported natively by Quartz, GitHub, and Obsidian’s preview.
Flowchart
Declare a direction (TD top-down, LR left-right), then nodes and edges.
flowchart LR
A[Start] --> B{Decision}
B -->|Yes| C[Do thing]
B -->|No| D[Skip]flowchart LR A[Start] --> B{Decision} B -->|Yes| C[Do thing] B -->|No| D[Skip]
Node shapes: [Rectangle], (Rounded), {Decision}, ((Circle)), [[Subroutine]].
Sequence diagram
Models interactions between participants over time.
sequenceDiagram
participant Client
participant Server
Client->>Server: Request
Server-->>Client: ResponsesequenceDiagram participant Client participant Server Client->>Server: Request Server-->>Client: Response
Use ->> for a solid arrow (call), -->> for a dashed arrow (return), activate/deactivate to show lifelines.
Class diagram
classDiagram
class Animal {
+String name
+makeSound()
}
Animal <|-- DogclassDiagram class Animal { +String name +makeSound() } Animal <|-- Dog
Gantt chart
gantt
dateFormat YYYY-MM-DD
section Phase 1
Task A :a1, 2026-01-01, 5d
Task B :after a1, 3dgantt dateFormat YYYY-MM-DD section Phase 1 Task A :a1, 2026-01-01, 5d Task B :after a1, 3d
Cheatsheet
Diagram types
flowchart TD# top-down flowchartsequenceDiagram# actor interactionsclassDiagram# UML class relationshipsstateDiagram-v2# state machineserDiagram# entity-relationshipgantt# project timelinespie# pie chart
Styling
style A fill:#f9f,stroke:#333,stroke-width:2px# style a single nodeclassDef highlight fill:#f96;# define a reusable classclass A,B highlight# apply a class to nodes