mermaid-syntax
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMermaid Syntax Reference
Mermaid语法参考
A comprehensive reference for all 23 Mermaid diagram types plus configuration and theming. This skill provides official Mermaid syntax documentation sourced from the mermaid-skill project (auto-synced from upstream Mermaid docs).
This skill ships reference material, not runnable scripts. Read the relevant reference file with , apply the syntax, and write the diagram into the user's artefact. Do not -execute anything from — they are Mermaid syntax docs, not commands.
ReadBashreferences/To look up syntax for a specific diagram type, identify the type from the table below and read the corresponding reference file.
本参考涵盖了全部23种Mermaid图表类型以及配置和主题相关内容。本Skill提供官方Mermaid语法文档,内容源自mermaid-skill项目(自动同步自上游Mermaid文档)。
本Skill仅提供参考资料,不包含可运行脚本。 使用命令读取相关参考文件,应用语法规则,将图表写入用户的工件中。请勿对目录下的内容执行命令——这些是Mermaid语法文档,而非命令。
Readreferences/Bash如需查询特定图表类型的语法,请从下表中确定类型并读取对应的参考文件。
Supported Diagram Types
支持的图表类型
Select the appropriate diagram type and read the corresponding reference file:
| Type | Reference | ArcKit Commands Using It |
|---|---|---|
| Flowchart | flowchart.md | |
| Sequence Diagram | sequenceDiagram.md | |
| Class Diagram | classDiagram.md | — |
| State Diagram | stateDiagram.md | — |
| ER Diagram | entityRelationshipDiagram.md | |
| Gantt Chart | gantt.md | |
| Pie Chart | pie.md | |
| Mindmap | mindmap.md | |
| Timeline | timeline.md | |
| Git Graph | gitgraph.md | — |
| Quadrant Chart | quadrantChart.md | |
| Requirement Diagram | requirementDiagram.md | — |
| C4 Diagram | c4.md | |
| Sankey Diagram | sankey.md | — |
| XY Chart | xyChart.md | — |
| Block Diagram | block.md | — |
| Packet Diagram | packet.md | — |
| Kanban | kanban.md | — |
| Architecture Diagram | architecture.md | — |
| Radar Chart | radar.md | — |
| Treemap | treemap.md | — |
| User Journey | userJourney.md | — |
| ZenUML | zenuml.md | — |
选择合适的图表类型并读取对应的参考文件:
| 类型 | 参考文件 | 使用该类型的Arckit命令 |
|---|---|---|
| 流程图 | flowchart.md | |
| 序列图 | sequenceDiagram.md | |
| 类图 | classDiagram.md | — |
| 状态图 | stateDiagram.md | — |
| ER图 | entityRelationshipDiagram.md | |
| 甘特图 | gantt.md | |
| 饼图 | pie.md | |
| 思维导图 | mindmap.md | |
| 时间线 | timeline.md | |
| Git图 | gitgraph.md | — |
| 象限图 | quadrantChart.md | |
| 需求图 | requirementDiagram.md | — |
| C4图 | c4.md | |
| 桑基图 | sankey.md | — |
| XY图 | xyChart.md | — |
| 块图 | block.md | — |
| 数据包图 | packet.md | — |
| 看板图 | kanban.md | — |
| 架构图 | architecture.md | — |
| 雷达图 | radar.md | — |
| 树形图 | treemap.md | — |
| 用户旅程图 | userJourney.md | — |
| ZenUML图 | zenuml.md | — |
Configuration & Theming
配置与主题
| Topic | Reference |
|---|---|
| Theming | config-theming.md |
| Directives | config-directives.md |
| Layouts | config-layouts.md |
| Configuration | config-configuration.md |
| Math | config-math.md |
| Tidy Tree | config-tidy-tree.md |
| Examples | examples.md |
| 主题 | 参考文件 |
|---|---|
| 主题设置 | config-theming.md |
| 指令 | config-directives.md |
| 布局 | config-layouts.md |
| 配置 | config-configuration.md |
| 数学公式 | config-math.md |
| 整洁树 | config-tidy-tree.md |
| 示例 | examples.md |
C4 Layout Science
C4布局科学
For research-backed C4 diagram layout guidance (declaration ordering, edge crossing targets, colour standards, PlantUML directional hints), see c4-layout-science.md. This ArcKit-specific reference supplements the upstream C4 syntax reference with graph drawing science and layout optimisation techniques.
如需基于研究的C4图布局指导(声明顺序、边缘交叉目标、颜色标准、PlantUML方向提示),请查看c4-layout-science.md。这份Arckit专属参考资料在C4语法参考的基础上,补充了图形绘制科学和布局优化技巧。
Common Syntax Gotchas
常见语法陷阱
These are the most common Mermaid syntax errors encountered when generating diagrams:
| Gotcha | Problem | Fix |
|---|---|---|
| Mermaid flowchart parser rejects HTML in edge labels | Use comma-separated text: |
| | Use a different ID: |
| Gantt date formats | Gantt requires specific date format | Use |
| Gantt task status | Invalid task status keywords | Valid: |
| Parentheses in labels | Unescaped | Wrap in quotes: |
| Special chars in IDs | Hyphens, dots, spaces in node IDs | Use camelCase or underscores: |
| Missing semicolons in ER | ER diagram attributes need specific syntax | Follow |
| Subgraph naming | Subgraph IDs with spaces need quotes | |
以下是生成图表时最常遇到的Mermaid语法错误:
| 陷阱 | 问题 | 修复方案 |
|---|---|---|
流程图边缘标签中的 | Mermaid流程图解析器拒绝边缘标签中的HTML | 使用逗号分隔文本: |
将 | | 使用其他ID: |
| 甘特图日期格式 | 甘特图要求特定的日期格式 | 使用 |
| 甘特图任务状态 | 无效的任务状态关键字 | 有效值: |
| 标签中的括号 | 未转义的 | 用引号包裹: |
| ID中的特殊字符 | 节点ID中的连字符、点号、空格 | 使用驼峰式或下划线: |
| ER图中缺少分号 | ER图属性需要特定语法 | 遵循 |
| 子图命名 | 包含空格的子图ID需要加引号 | |
ArcKit Integration
Arckit集成
This skill handles conversational Mermaid syntax questions — quick lookups, syntax examples, troubleshooting rendering issues, and learning about diagram types.
For formal architecture diagram generation with document control, project integration, C4 layout science, and governance compliance, use the command instead. It generates versioned diagram artifacts saved to your project directory with full traceability to requirements and architecture principles.
/arckit:diagram本Skill处理对话式Mermaid语法问题——快速查询、语法示例、渲染问题排查以及图表类型学习。
如需具备文档管控、项目集成、C4布局科学和合规治理的正式架构图生成功能,请使用命令。该命令会生成带版本的图表工件并保存到项目目录,同时具备与需求和架构原则的完整可追溯性。
/arckit:diagram