Pele · Mermaid diagrams as themeable SVG


How it really works

Write Mermaid syntax, Pele renders it to SVG. Try enhancing the instance beneath.

flowchart TD  A[Mermaid text] --> B{Flowchart?}  B -- Yes --> C[Pele]  B -- No --> D[Mermaid]  C --> E([SVG])  D --> E
YesNoMermaid textual contentFlowchart?PeleMermaidSVG

Use CSS variables to set colours and fonts. Color adjustments apply with out re-rendering.

.pele {  --pele-bg: #fffcf0;  --pele-fg: #100f0f;  --pele-muted: #6f6e69;  --pele-line: #100f0f;  --pele-surface: #f2f0e5;  --pele-surface-alt: #e6e4d9;  --pele-border: #cecdc3;}

Pele

ThemesVariablesLightDark

Why Pele?

Zero dependencies, 6× smaller, and as much as 500× quicker than Mermaid.js. Pele helps each diagram sort constructed into Mermaid 12.1.0.

Pele Mermaid.js
Bundle measurement gzip 230 kB 1.6 MB
Render time 0.05–0.3 ms 6–82 ms
Direct dependencies 0 23
Small screens Adapts the structure Scales the diagram
Theming CSS variables Theme configuration

Pele in your app

Pass Mermaid syntax to render() and insert the returned SVG into your web page.

import { render } from 'pele';const { svg } = render(`flowchart LR  A[Mermaid text] --> B[SVG]`);doc.querySelector('#diagram').innerHTML = svg;

Explore

Pele in use

Pele is open source, developed for Obsidian to render diagrams shortly and match your theme. It is called after Pele, the goddess of volcanoes and fireplace.



Source link