Skip to content

Render Mermaid diagrams

Juan Luis Cano Rodríguez edited this page Dec 20, 2023 · 1 revision

First, install the Mermaid CLI:

$ npm install [-g] @mermaid-js/mermaid-cli
$ mmdc -V
10.6.1

Then, generate the PNG file:

$ cat mermaid-source.md
```mermaid
flowchart TD
    A[Start] --> B[Enter Project Name: Example Project];
    B --> C3[Select Tools: None];
    B --> C1[Select Tools: lint, docs, PySpark];
    B --> C2[Select Tools: All];
    C1 --> D1[Include Example Pipeline?];
    C2 --> D2[Include Example Pipeline?];
    C3 --> D3[Include Example Pipeline?];
    D1 -->|Yes| E1[New Project Created\nName: Example Project\nTools: lint, docs, PySpark\nExample: Yes];
    D1 -->|No| E2[New Project Created\nName: Example Project\nTools: lint, docs, PySpark\nExample: No];
    D2 -->|Yes| F1[New Project Created\nName: Example Project\nTools: All: lint, test, logging, docs, data, PySpark, viz \nExample: Yes];
    D2 -->|No| F2[New Project Created\nName: Example Project\nTools: All: lint, test, logging, docs, data, PySpark, viz \nExample: No];
    D3 -->|Yes| G1[New Project Created\nName: Example Project\nTools: None\nExample: Yes];
    D3 -->|No| G2[New Project Created\nName: Example Project\nTools: None\nExample: No];
```
$ mmdc -i mermaid-source.md -o mermaid-image.png -p docs/source/puppeteer-config.json -s 2
Found 1 mermaid charts in Markdown input
 ✅ ./mermaid-image-1.png
Clone this wiki locally