mermaid
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMermaid Skill
Mermaid Skill
Use this skill to quickly validate Mermaid diagrams by parsing + rendering them with the official Mermaid CLI.
使用该Skill可通过官方Mermaid CLI解析并渲染图表,快速验证Mermaid图。
Prerequisites
前提条件
- Node.js + npm (for ).
npx - First run downloads a headless Chromium via Puppeteer. If Chromium is missing, set .
PUPPETEER_EXECUTABLE_PATH
- Node.js + npm(用于)。
npx - 首次运行会通过Puppeteer下载无头Chromium。如果Chromium缺失,请设置环境变量。
PUPPETEER_EXECUTABLE_PATH
Tool
工具
Validate a diagram
验证图表
bash
./tools/validate.sh diagram.mmd [output.svg]- Parses and renders the Mermaid source.
- Non-zero exit = invalid Mermaid syntax.
- Prints an ASCII preview using (best-effort; not all diagram types are supported).
beautiful-mermaid - If is omitted, the SVG is rendered to a temp file and discarded.
output.svg
bash
./tools/validate.sh diagram.mmd [output.svg]- 解析并渲染Mermaid源码。
- 非零退出码表示Mermaid语法无效。
- 使用打印ASCII预览(尽最大努力支持;并非所有图表类型都兼容)。
beautiful-mermaid - 如果省略,SVG会渲染到临时文件并随后丢弃。
output.svg
Workflow (short)
简短工作流程
- If the diagram will live in Markdown: draft it in a standalone first (the tool only validates plain Mermaid files).
diagram.mmd - Write/update .
diagram.mmd - Run .
./tools/validate.sh diagram.mmd - Fix any errors shown by the CLI.
- Once it validates, copy the Mermaid block into your Markdown file.
- 如果图表将嵌入Markdown中:先在独立的文件中起草(该工具仅验证纯Mermaid文件)。
diagram.mmd - 编写/更新。
diagram.mmd - 运行。
./tools/validate.sh diagram.mmd - 修复CLI提示的所有错误。
- 验证通过后,将Mermaid代码块复制到你的Markdown文件中。