Mermaid Plugin
The Mermaid plugin enables rendering of Mermaid diagrams directly in your markdown documentation.Features
- Simple Syntax - Use standard Mermaid code blocks
- All Diagram Types - Flowcharts, sequence diagrams, class diagrams, and more
- Automatic Rendering - Converts code blocks to interactive diagrams
- Theme Integration - Respects your site’s light/dark theme
Configuration
The plugin is automatically enabled:packages/doom/src/plugins/mermaid/index.ts:5-12
Usage
Create diagrams using Mermaid code blocks:Diagram Types
Flowcharts
Create flowcharts to visualize processes:Sequence Diagrams
Document interactions between systems:Class Diagrams
Show object-oriented structure:State Diagrams
Visualize state machines:Entity Relationship Diagrams
Document database schemas:Gantt Charts
Create project timelines:Pie Charts
Display proportions:Implementation
The plugin transforms Mermaid code blocks into React components:packages/doom/src/plugins/mermaid/remark-mermaid.ts:5-25
Advanced Features
Custom Styling
Customize Mermaid diagram appearance:Configuration
Add Mermaid configuration:Notes and Comments
Add documentation to your diagrams:Best Practices
- Keep It Simple - Complex diagrams are hard to read
- Use Labels - Add descriptive text to nodes and edges
- Consistent Direction - Use TD (top-down) or LR (left-right) consistently
- Test Rendering - Preview diagrams before committing
- Add Context - Include explanatory text around diagrams
Common Use Cases
Architecture Diagrams
Deployment Flow
Plugin Lifecycle
Troubleshooting
Diagram Not Rendering
Ensure:- Code block uses
mermaidlanguage identifier - Syntax is valid (test on mermaid.live)
- No conflicting plugins
Syntax Errors
Validate your diagram:- Copy diagram code
- Test on mermaid.live
- Fix syntax errors
- Update your docs