rspress-plugin-mermaid
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

rspress-plugin-mermaid NPM Version

简体中文

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]
```
sample

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',
      },
    }),
  ],
});

Readme

Keywords

Package Sidebar

Install

npm i rspress-plugin-mermaid

Weekly Downloads

35

Version

0.3.0

License

MIT

Unpacked Size

7.99 kB

Total Files

9

Last publish

Collaborators

  • linbudu