Mermaid diagrams
Mermaid is a JavaScript-based diagramming tool that renders markdown-inspired text definitions to create diagrams dynamically.Creating a Mermaid diagram
You can insert a Mermaid diagram in two ways:- Type
:::mermaidand press Enter - Use the slash command menu (
/) and select “Mermaid”
Flowcharts
Create flowcharts to visualize processes and workflows:TD- Top to bottomLR- Left to rightRL- Right to leftBT- Bottom to top
Sequence diagrams
Document interactions between different components:State diagrams
Visualize state transitions:Pie charts
Display data distributions:Class diagrams
Model object-oriented structures:Mermaid diagrams render automatically after a brief delay. If you see an error, check your syntax against the Mermaid documentation.
PlantUML diagrams
PlantUML is a versatile tool for creating UML diagrams from plain text descriptions.Creating a PlantUML diagram
You can insert a PlantUML diagram in two ways:- Type
:::plantumland press Enter - Use the slash command menu (
/) and select “Plant UML”
Sequence diagrams
Every PlantUML diagram starts with@startuml and ends with @enduml:
Use case diagrams
Model system functionality:Class diagrams
Document software architecture:Activity diagrams
Illustrate workflows:Component diagrams
Show system components:Tips for creating diagrams
Keep it simple
Keep it simple
Start with basic diagrams and add complexity gradually. Complex diagrams can be harder to maintain and understand.
Use consistent naming
Use consistent naming
Maintain consistent naming conventions for nodes, actors, and components across your diagrams.
Add comments
Add comments
Both Mermaid and PlantUML support comments. Use them to document your diagram logic:
- Mermaid:
%% This is a comment - PlantUML:
' This is a comment
Test incrementally
Test incrementally
Build your diagrams step by step. If a diagram fails to render, you’ll know exactly which line caused the issue.
Choosing between Mermaid and PlantUML
- Mermaid
- PlantUML
Best for:
- Flowcharts and process diagrams
- Gantt charts
- Git graphs
- Quick visualizations
- Offline work (renders locally)