NoteDiscovery supports Mermaid diagrams directly in your markdown notes! Mermaid lets you create diagrams and visualizations using text-based definitions, making it easy to version control and collaborate.
Simply create a code block with the language set to mermaid:
```mermaid
graph TD
A[Start] --> B{Is it working?}
B -->|Yes| C[Great!]
B -->|No| D[Debug]
D --> B
``````mermaid
graph LR
A[Square Rect] --> B((Circle))
A --> C(Round Rect)
B --> D{Rhombus}
C --> D
```Preview:
graph LR
A[Square Rect] --> B((Circle))
A --> C(Round Rect)
B --> D{Rhombus}
C --> D
```mermaid
sequenceDiagram
Alice->>John: Hello John, how are you?
John-->>Alice: Great!
Alice-)John: See you later!
```Preview:
sequenceDiagram
Alice->>John: Hello John, how are you?
John-->>Alice: Great!
Alice-)John: See you later!
```mermaid
classDiagram
Animal <|-- Duck
Animal <|-- Fish
Animal : +int age
Animal : +String gender
Animal: +isMammal()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
```Preview:
classDiagram
Animal <|-- Duck
Animal <|-- Fish
Animal : +int age
Animal : +String gender
Animal: +isMammal()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
```mermaid
stateDiagram-v2
[*] --> Still
Still --> [*]
Still --> Moving
Moving --> Still
Moving --> Crash
Crash --> [*]
```Preview:
stateDiagram-v2
[*] --> Still
Still --> [*]
Still --> Moving
Moving --> Still
Moving --> Crash
Crash --> [*]
```mermaid
gantt
title Project Timeline
dateFormat YYYY-MM-DD
section Planning
Research :a1, 2024-01-01, 30d
Design :after a1, 20d
section Development
Backend :2024-02-01, 40d
Frontend :2024-02-15, 35d
section Testing
Integration Tests :2024-03-20, 15d
```Preview:
gantt
title Project Timeline
dateFormat YYYY-MM-DD
section Planning
Research :a1, 2024-01-01, 30d
Design :after a1, 20d
section Development
Backend :2024-02-01, 40d
Frontend :2024-02-15, 35d
section Testing
Integration Tests :2024-03-20, 15d
```mermaid
erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE-ITEM : contains
CUSTOMER }|..|{ DELIVERY-ADDRESS : uses
CUSTOMER {
string name
string email
string phone
}
ORDER {
int orderNumber
date orderDate
string status
}
```Preview:
erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE-ITEM : contains
CUSTOMER }|..|{ DELIVERY-ADDRESS : uses
CUSTOMER {
string name
string email
string phone
}
ORDER {
int orderNumber
date orderDate
string status
}
```mermaid
pie title Pet Preferences
"Dogs" : 45
"Cats" : 30
"Birds" : 15
"Fish" : 10
```Preview:
pie title Pet Preferences
"Dogs" : 45
"Cats" : 30
"Birds" : 15
"Fish" : 10
```mermaid
gitGraph
commit
commit
branch develop
checkout develop
commit
commit
checkout main
merge develop
commit
```Preview:
gitGraph
commit
commit
branch develop
checkout develop
commit
commit
checkout main
merge develop
commit
```mermaid
journey
title My Working Day
section Go to work
Make tea: 5: Me
Go upstairs: 3: Me
Do work: 1: Me, Cat
section Go home
Go downstairs: 5: Me
Sit down: 5: Me
```Preview:
journey
title My Working Day
section Go to work
Make tea: 5: Me
Go upstairs: 3: Me
Do work: 1: Me, Cat
section Go home
Go downstairs: 5: Me
Sit down: 5: Me
```mermaid
mindmap
root((NoteDiscovery))
Features
Markdown
Themes
Search
Folders
Integrations
MathJax
Mermaid
Syntax Highlighting
Benefits
Fast
Simple
Offline-first
```Preview:
mindmap
root((NoteDiscovery))
Features
Markdown
Themes
Search
Folders
Integrations
MathJax
Mermaid
Syntax Highlighting
Benefits
Fast
Simple
Offline-first
Mermaid diagrams automatically adapt to your current NoteDiscovery theme:
- Light themes use the default Mermaid color scheme
- Dark themes use dark-optimized colors with proper contrast
- Theme changes automatically re-render all diagrams
- Keep it simple: Start with basic diagrams and add complexity as needed
- Use comments: Add
%%for comments in your Mermaid code - Test syntax: If a diagram doesn't render, check the Mermaid documentation
- Export: Diagrams are included when you export notes to HTML
For the complete Mermaid syntax and more diagram types, visit the official documentation:
- Mermaid Documentation
- Live Editor - Test your diagrams online
Pro Tip: Combine Mermaid diagrams with LaTeX math expressions and code blocks for comprehensive technical documentation! 📊