rspress-plugin-mermaid
v0.3.0
Published
Rspress plugin to render mermaid diagrams
Downloads
746
Readme
rspress-plugin-mermaid
Rspress plugin to render mermaid diagrams in markdown files.
Write mermaid as code blocks in markdown files and they will be rendered as SVGs:
```mermaid
flowchart TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
C -->|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
```
Usage
npm i rspress-plugin-mermaid
pnpm add rspress-plugin-mermaid
import * as path from 'path';
import { defineConfig } from 'rspress/config';
import mermaid from 'rspress-plugin-mermaid';
export default defineConfig({
root: path.join(__dirname, 'docs'),
plugins: [mermaid()],
});
Configure
mermaidConfig
Mermaid configuration options, will be passed to mermaid.initialize
function. See mermaid documentation for more details.
- Type:
object
import * as path from 'path';
import { defineConfig } from 'rspress/config';
import mermaid from 'rspress-plugin-mermaid';
export default defineConfig({
root: path.join(__dirname, 'docs'),
plugins: [
mermaid({
mermaidConfig: {
theme: 'forest',
},
}),
],
});