1.3 KiB
1.3 KiB
Mermaid
The theme supports embedding diagrams generated by Mermaid within articles.
Configuration
Enable the feature in .vuepress/config.ts:
export default defineUserConfig({
theme: plumeTheme({
markdown: {
mermaid: true,
},
})
})
You also need to install the mermaid library:
npm install mermaid
Syntax
Use the mermaid code block or specific diagram type code blocks (e.g., sequence, class, flow, etc.).
```mermaid
flowchart TD
A[Start] --> B{Is it?}
B -- Yes --> C[OK]
C --> D[Rethink]
D --> B
B -- No --> E[End]
```
Supported Diagram Types
You can use these aliases directly:
class->classDiagramc4c->C4Contexter->erDiagramgantt->ganttgit-graph->gitGraphjourney->journeymindmap->mindmappie->piequadrant->quadrantChartrequirement->requirementDiagramsankey->sankey-betasequence->sequenceDiagramstate->stateDiagram-v2timeline->timelinexy->xychart-beta
Example with title:
```sequence Diagram Title
Alice->>John: Hello John, how are you?
John-->>Alice: Great!
Alice-)John: See you later!
```