用 Markdown 画思维导图:markmap 等工具入门
你写的 Markdown 列表,本身就是一棵“树”。用 markmap 这类工具,能把缩进列表一键变成可折叠、可缩放的思维导图,做读书笔记和知识梳理特别顺手。
用 Markdown 畫思維導圖:markmap 等工具入門
你寫的 Markdown 清單,本身就是一棵「樹」。用 markmap 這類工具,能把縮排清單一鍵變成可折疊、可縮放的思維導圖,做讀書筆記和知識梳理特別順手。
Drawing Mind Maps in Markdown: Getting Started with markmap
The Markdown list you write is already a "tree." Tools like markmap turn an indented list into a collapsible, zoomable mind map with one click—handy for reading notes and knowledge structuring.
一、为什么 Markdown 适合画脑图
思维导图的本质就是“层级结构”,而 Markdown 的无序列表 + 缩进天生就是层级结构。你不需要拖拽节点,只要用 - 和空格表达从属关系,工具就能自动排版成树状图。
好处很明显:纯文本、可版本化、能 diff、方便和笔记打通。这正是 Markdown 做笔记与知识管理 的延伸。
二、markmap 是什么
markmap 是最流行的“Markdown 转思维导图”开源工具,提供 VS Code 插件、在线编辑器、命令行(markmap-cli)三种用法。它读取你的 .md,输出一个可缩放、可折叠节点的交互式网页脑图。
- 在线版:打开 markmap 官网,粘贴 Markdown 即可看效果,零安装。
- VS Code 插件:装 “Markmap Preview”,右侧实时预览脑图。
- 命令行:
npx markmap-cli 你的文件.md生成 HTML。
三、怎么写一份脑图源文件
就是平时写列表,用缩进表达层级。下面这份 Markdown 会渲染成一张脑图:
# 我的知识框架
## 输入
- 阅读
- 书
- 论文
- 听课
## 加工
- 卡片笔记
- 思维导图
## 输出
- 博客
- 文档
规则很简单:# 是一级主题,## 是分支,- 嵌套越多越深。想加粗、加链接也行,markmap 会保留。
小技巧:在 365Lab 编辑器 里先把列表写顺、确认缩进层级,再贴到 markmap,几乎零试错。
四、思维导图 vs 流程图怎么选
两者都靠“语言标注的代码块”实现,但表达意图不同:
- 思维导图:表达“分类与从属”,适合梳理概念、做大纲、记笔记(本文)。
- 流程图/时序图:表达“步骤与流向”,适合讲流程、算法、时序,详见 用 Mermaid 画流程图。
| 维度 | 思维导图(markmap) | 流程图(Mermaid) |
|---|---|---|
| 表达重点 | 层级/分类 | 步骤/流向 |
| 源格式 | 缩进列表 | 图语法(graph/seq) |
| 典型用途 | 大纲/笔记/脑暴 | 流程/时序/架构 |
五、导出与分享
markmap 生成的脑图是 HTML,可直接打开或嵌入网页;也能导出 PNG/SVG 当配图。需要放进 PPT 时,参考 用 Markdown 做 PPT 的嵌入思路。
六、常见问题
Q:和 Mermaid 冲突吗?
A:不冲突。markmap 专门吃列表生成脑图,Mermaid 吃图语法生成流程图,二者可以同一篇文档里并存。
Q:中文显示正常吗?
A:正常。markmap 默认字体支持中文,粘贴中文列表即可。
Q:能协作编辑吗?
A:源文件就是 .md,放仓库里配合 团队协作 就能多人维护。
Q:和代码块语法有关系吗?
A:markmap 也常以“语言标注为 markmap 的代码块”形式出现,底层机制和 Markdown 代码块 一致。
先把列表语法练熟,看 Markdown 语法速查表;要做流程类图,看 用 Mermaid 画流程图;从 Markdown 入门 系统学起更稳。
一、為什麼 Markdown 適合畫腦圖
思維導圖的本質就是「層級結構」,而 Markdown 的無序清單 + 縮排天生就是層級結構。你不需要拖曳節點,只要用 - 和空格表達從屬關係,工具就能自動排版成樹狀圖。
好處很明顯:純文字、可版本化、能 diff、方便和筆記打通。這正是 Markdown 做筆記與知識管理 的延伸。
二、markmap 是什麼
markmap 是最流行的「Markdown 轉思維導圖」開源工具,提供 VS Code 外掛、線上編輯器、命令列(markmap-cli)三種用法。它讀取你的 .md,輸出一個可縮放、可折疊節點的互動式網頁腦圖。
- 線上版:打開 markmap 官網,貼上 Markdown 即可看效果,零安裝。
- VS Code 外掛:裝「Markmap Preview」,右側即時預覽腦圖。
- 命令列:
npx markmap-cli 你的文件.md產生 HTML。
三、怎麼寫一份腦圖源檔
就是平時寫清單,用縮排表達層級。下面這份 Markdown 會渲染成一張腦圖:
# 我的知識框架
## 輸入
- 閱讀
- 書
- 論文
- 聽課
## 加工
- 卡片筆記
- 思維導圖
## 輸出
- 部落格
- 文件
規則很簡單:# 是一級主題,## 是分支,- 巢狀越多越深。想加粗、加連結也行,markmap 會保留。
小技巧:在 365Lab 編輯器 裡先把清單寫順、確認縮排層級,再貼到 markmap,幾乎零試錯。
四、思維導圖 vs 流程圖怎麼選
兩者都靠「語言標註的程式碼塊」實現,但表達意圖不同:
- 思維導圖:表達「分類與從屬」,適合梳理概念、做大綱、記筆記(本文)。
- 流程圖 / 時序圖:表達「步驟與流向」,適合講流程、演算法、時序,詳見 用 Mermaid 畫流程圖。
| 維度 | 思維導圖(markmap) | 流程圖(Mermaid) |
|---|---|---|
| 表達重點 | 層級 / 分類 | 步驟 / 流向 |
| 源格式 | 縮排清單 | 圖語法(graph/seq) |
| 典型用途 | 大綱 / 筆記 / 腦暴 | 流程 / 時序 / 架構 |
五、匯出與分享
markmap 產生的腦圖是 HTML,可直接開啟或嵌入網頁;也能匯出 PNG/SVG 當配圖。需要放進 PPT 時,參考 用 Markdown 做 PPT 的嵌入思路。
六、常見問題
Q:和 Mermaid 衝突嗎?
A:不衝突。markmap 專門吃清單產生腦圖,Mermaid 吃圖語法產生流程圖,二者可以同一篇文件裡並存。
Q:中文顯示正常嗎?
A:正常。markmap 預設字體支援中文,貼上中文清單即可。
Q:能協作編輯嗎?
A:源檔就是 .md,放倉庫裡配合 團隊協作 就能多人維護。
Q:和程式碼塊語法有關係嗎?
A:markmap 也常以「語言標註為 markmap 的程式碼塊」形式出現,底層機制和 Markdown 程式碼塊 一致。
先把清單語法練熟,看 Markdown 語法速查表;要做流程類圖,看 用 Mermaid 畫流程圖;從 Markdown 入門 系統學起更穩。
1. Why Markdown fits mind maps
A mind map is fundamentally a "hierarchy," and Markdown's unordered list + indentation is a hierarchy by nature. You don't drag nodes around—just use - and spaces to express parent/child relationships, and the tool lays out a tree automatically.
The benefits are obvious: plain text, versionable, diff-able, and easy to connect with your notes. This is exactly the extension of Markdown notes & knowledge management.
2. What markmap is
markmap is the most popular open-source tool for "Markdown to mind map," offering three modes: a VS Code extension, an online editor, and a CLI (markmap-cli). It reads your .md and outputs an interactive, zoomable, collapsible web mind map.
- Online: Open the markmap site and paste Markdown to see it instantly—zero install.
- VS Code extension: Install "Markmap Preview" for a live mind-map preview on the right.
- CLI:
npx markmap-cli your-file.mdgenerates HTML.
3. How to write a mind-map source file
Just write lists as usual, using indentation for hierarchy. This Markdown renders as a mind map:
# My knowledge framework
## Input
- Reading
- Books
- Papers
- Lectures
## Processing
- Card notes
- Mind maps
## Output
- Blog
- Docs
The rule is simple: # is a top-level topic, ## is a branch, and deeper - nesting goes further down. Bold and links work too—markmap preserves them.
Tip: In the 365Lab editor, first get your list right and confirm the indentation levels, then paste into markmap—almost zero trial and error.
4. Mind map vs flowchart: which to use
Both rely on "language-annotated code blocks," but they express different intents:
- Mind map: Expresses "categories and hierarchy," great for organizing concepts, making outlines, and taking notes (this article).
- Flowchart / sequence diagram: Expresses "steps and flow," great for processes, algorithms, and sequences—see Drawing flowcharts with Mermaid.
| Dimension | Mind map (markmap) | Flowchart (Mermaid) |
|---|---|---|
| Focus | Hierarchy / categories | Steps / flow |
| Source format | Indented list | Diagram syntax (graph/seq) |
| Typical use | Outlines / notes / brainstorming | Flows / sequences / architecture |
5. Export & sharing
The mind map markmap generates is HTML—open it directly or embed it in a web page; you can also export PNG/SVG as illustrations. To drop it into a PPT, refer to the embedding approach in Making PPTs with Markdown.
6. FAQ
Q: Does it conflict with Mermaid?
A: No conflict. markmap specifically consumes lists to build mind maps, while Mermaid consumes diagram syntax to build flowcharts; the two can coexist in the same document.
Q: Does markmap display Chinese normally?
A: Yes. markmap's default font supports Chinese—just paste a Chinese list.
Q: Can mind maps be collaboratively edited?
A: The source is just .md; put it in a repo and pair it with team collaboration to maintain it with multiple people.
Q: Is it related to code-block syntax?
A: markmap also often appears as a code block annotated with the markmap language; its underlying mechanism is the same as Markdown code blocks.
To master list syntax first, see the Markdown syntax cheat sheet; for flow-style diagrams, see Drawing flowcharts with Mermaid; start systematically with Markdown Basics.