Pele – Mermaid 图表作为可主题化的 SVG
Pele – Mermaid diagrams as themeable SVG

原始链接: https://pele.run/

Pele 是一个轻量、快速的 Mermaid.js 替代品,用于将 Mermaid 图表语法渲染为 SVG。它零依赖,体积缩小 6 倍(gzip 后 230 kB 对比 1.6 MB),速度最高快 500 倍(0.05–0.3 毫秒对比 6–82 毫秒),同时支持 Mermaid 12.1.0 的所有图表类型。Pele 提供基于 CSS 变量的主题,颜色和字体可无需重新渲染即可更改,并针对小屏幕调整布局而非缩放。可通过 npm、pnpm、yarn 或 bun 安装,并通过返回 SVG 的简单 render() API 使用。开源且为 Obsidian 打造,Pele 以火山与火之女神命名。

一个 Hacker News 帖子介绍了“Pele – Mermaid diagrams as themeable SVG”(pele.run),由 dchest 提交,获得 12 分和 3 条评论。评论者讨论官方 Mermaid 库是否仍需要浏览器环境来进行 SVG 布局,指出 Pele 可能适合在其他地方嵌入 Mermaid 渲染。一位用户询问 Pele 是否开源,并在找到仓库位于 github.com/obsidianmd/pele 前难以找到,然后建议在网站上添加 GitHub 图标/链接。另一位评论者确认了该 GitHub 链接。页面还包含关于 YC Winter 2027 批次申请的公告(开放至 11 月 2 日)以及标准的 Hacker News 页脚链接。
相关文章

原文

How it works

Write Mermaid syntax, Pele renders it to SVG. Try editing the example below.

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

Use CSS variables to set colors and fonts. Color changes apply without 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 up to 500× faster than Mermaid.js. Pele supports every diagram type built into Mermaid 12.1.0.

PeleMermaid.js
Bundle size gzip230 kB1.6 MB
Render time0.05–0.3 ms6–82 ms
Direct dependencies023
Small screensAdapts the layoutScales the diagram
ThemingCSS variablesTheme configuration

Pele in your app

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

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

Explore

Pele in use

Pele is open source, developed for Obsidian to render diagrams quickly and match your theme. It is named after Pele, the goddess of volcanoes and fire.

联系我们 contact @ memedata.com