微信扫码
添加专属顾问
我要投稿
发现新大陆!用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
https://github.com/mermaid-js/mermaid
https://mermaid.live/edit
长按?关注- 数据STUDIO -设为星标,干货速递
53AI,企业落地大模型首选服务商
产品:场景落地咨询+大模型应用平台+行业解决方案
承诺:免费场景POC验证,效果验证后签署服务协议。零风险落地应用大模型,已交付160+中大型企业
2025-04-25
Manus开源版本!无需邀请码,老金手把手教你咋用!
2025-04-25
MarkItDown MCP:一款好用的将文件和办公文档转换为Markdown的AI工具!
2025-04-24
AI+SQL客户端,这款开源神器让数据库管理像聊天一样简单!
2025-04-24
效率革命!GitHub爆火的开源神器MinerU:PDF、网页、电子书一键转Markdown
2025-04-24
Suna:构建你专属“通用智能体”的开源利器
2025-04-24
开源TTS领域迎来重磅新星!Dia-1.6B:超逼真对话生成,开源2天斩获6.5K Star!
2025-04-24
仅用3周时间,就打造出Manus开源平替!贡献源代码,免费用
2025-04-23
只需6G显存,就能本地跑的AI视频算法,开源了!
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-08-13
2024-12-26
2025-04-21
2025-04-19
2025-04-17
2025-04-15
2025-04-13
2025-04-10
2025-04-07
2025-04-03