微信扫码
添加专属顾问
我要投稿
发现新大陆!用Markdown语法轻松绘制复杂流程图,提升技术文档效率。 核心内容: 1. Mermaid:颠覆传统绘图方式的开源工具 2. 支持Markdown语法,轻松集成各类图表 3. 低学习成本,实时预览,版本管理等优势
在技术文档中插入一张流程图需要多久?传统方式可能需要30分钟调整Visio图形,而现在通过Mermaid,只需3分钟编写类Markdown文本即可完成。这个拥有78.4k GitHub星标的开源项目,正在颠覆技术文档的创作方式。
Mermaid 是一款基于 JavaScript 的图表和制图工具,它使用 Markdown 风格的文本定义和渲染器来创建和修改复杂的图表。Mermaid 的主要目的是帮助文档跟上开发的步伐。
以下是 Mermaid 支持的一些主要图表类型:
Flowchart
)Sequence Diagram
)Class Diagram
)State Diagram
)Entity Relationship Diagram, ERD
)Gantt Diagram
)Pie Chart
)User Journey Diagram
)Git Graph
)Requirement Diagram
)<div class="mermaid">
graph LR
A[需求评审] --> B(技术设计)
B --> C{复杂度评估}
C -->|高| D[拆分任务]
C -->|低| E[直接开发]
</div>
<script src="https://cdn.jsdelivr.net/npm/mermaid@10.0.0/dist/mermaid.min.js"></script>
安装Mermaid插件后支持:
flowchart LR
A[Hard] -->|Text| B(Round)
B --> C{Decision}
C -->|One| D[Result 1]
C -->|Two| E[Result 2]
sequenceDiagram
Alice->>John: Hello John, how are you?
loop HealthCheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
gantt
section Section
Completed :done, des1, 2014-01-06,2014-01-08
Active :active, des2, 2014-01-07, 3d
Parallel 1 : des3, after des1, 1d
Parallel 2 : des4, after des1, 1d
Parallel 3 : des5, after des3, 1d
Parallel 4 : des6, after des4, 1d
classDiagram
Class01 <|-- AveryLongClass : Cool
<<Interface>> Class01
Class09 --> C2 : Where am I?
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
class Class10 {
<<service>>
int id
size()
}
stateDiagram-v2
[*] --> Still
Still --> [*]
Still --> Moving
Moving --> Still
Moving --> Crash
Crash --> [*]
pie
"Dogs" : 386
"Cats" : 85.9
"Rats" : 15
Mermaid 不仅让图表绘制变得轻松简单,还能极大地提高我们的工作效率和文档质量,让我们用类似 Markdown 的简洁文本语法来定义图表,极大提高程序员绘图能力。
gitGraph:
options
{
"nodeSpacing": 150,
"nodeRadius": 10
}
end
commit
branch newbranch
checkout newbranch
commit
commit
checkout master
commit
commit
merge newbranch
1
journey
title My working day
section Go to work
Make tea: 5: Me
Go upstairs: 3: Me
Do work: 1: Me, Cat
section Go home
Go downstairs: 5: Me
Sit down: 3: Me
53AI,企业落地大模型首选服务商
产品:场景落地咨询+大模型应用平台+行业解决方案
承诺:免费场景POC验证,效果验证后签署服务协议。零风险落地应用大模型,已交付160+中大型企业
2025-05-27
Dify工具插件开发和智能体开发全流程实战
2025-05-27
一个让工作效率翻倍的AI神器,Cherry Studio你值得拥有!
2025-05-27
Docext:无需 OCR,本地部署的文档提取神器,企业数据处理新选择
2025-05-26
太猛了,字节把GPT-4o级图像模型开源了!
2025-05-26
Qwen3硬核解析:从36万亿Token到“思考预算”
2025-05-26
蚂蚁集团开源antv的MCP服务:AI智能体与数据可视化的桥梁如何搭建?
2025-05-26
MinerU:高精度纸媒文档解析与数据提取一站式解决方案
2025-05-26
顶级开发者默默换掉了基础大模型
2024-07-25
2025-01-01
2025-01-21
2024-05-06
2024-09-20
2024-07-20
2024-07-11
2024-06-12
2024-12-26
2024-08-13
2025-05-26
2025-05-25
2025-05-23
2025-05-17
2025-05-17
2025-05-17
2025-05-16
2025-05-14