Skip to content

Generate — Mindmap

/generate mindmap turns wiki pages and their heading structure into an interactive mindmap. Output is a self-contained HTML file — no CDN, no hosting, pan and zoom in any browser.

flowchart TB
Start([/generate mindmap topic]) --> Resolve
Resolve["Resolve topic<br/>tag / folder / file / all"] --> Outline
Outline["Build outline.md<br/>H1 root, H2 branches,<br/>H3 sub-branches,<br/>H4+ flattened"] --> Hash
Hash["Compute source-hash"] --> Render
Render{"markmap-cli<br/>available?"}
Render -- yes --> Markmap["markmap-cli → HTML<br/>(self-contained SVG + JS)"]
Render -- no --> Mermaid["fallback: Mermaid<br/>mindmap block"]
Markmap --> Sidecar
Mermaid --> Sidecar
Sidecar[".meta.yaml<br/>sidecar"] --> Done([Mindmap ready])
classDef engine fill:#5bbcd6,stroke:#2e6c7c,color:#0b0f14
classDef output fill:#7dcea0,stroke:#2d6a4f,color:#0b0f14
class Resolve,Outline,Hash,Render,Markmap,Mermaid engine
class Sidecar,Done output
/generate mindmap <topic> [--vault <name>] [--include-wikilinks] [--template <name>]
Terminal window
/generate mindmap rag-patterns --vault llm-wiki-research

Output:

✅ Mindmap generated
Topic: rag-patterns
Pages in: 6 (sorted)
Source hash: 8f3a1d6be711
Outline: vaults/llm-wiki-research/artifacts/mindmap/rag-patterns-2026-04-18.outline.md
HTML: vaults/llm-wiki-research/artifacts/mindmap/rag-patterns-2026-04-18.html
Sidecar: vaults/llm-wiki-research/artifacts/mindmap/rag-patterns-2026-04-18.meta.yaml
Open with: open vaults/llm-wiki-research/artifacts/mindmap/rag-patterns-2026-04-18.html

The .outline.md is kept — it’s the Markmap source, re-renderable and diffable.

Wiki headingMindmap position
Page title (H1 of page)Top branch under the topic root
H2Sub-branch
H3Sub-sub-branch
H4+Flattened into H3 as a bullet list
[[wikilink]]Italic label; with --include-wikilinks adds a “Related” sub-branch
Page .md path[Source]() leaf link per page

Lazy-installed on first run:

ToolInstallPurpose
markmap-clipnpm add -g markmap-cli (or npm i -g)Markdown → mindmap HTML

If the install fails (offline box, locked npm), the handler writes a Mermaid mindmap block to a plain .md file. You can paste it into Obsidian’s Mermaid renderer, into GitHub, or anywhere else Mermaid is supported.

The shipped template includes a non-standard markmap: YAML block that Markmap reads directly:

markmap:
colorFreezeLevel: 2
maxWidth: 300
initialExpandLevel: 2
spacing: { vertical: 6, horizontal: 80 }

Tools other than markmap-cli ignore it.

Drop <vault>/.templates/mindmap/default.md to ship house-tuned spacing / colour-freeze-level per vault.

The generated HTML is self-contained — works with the HTML Reader plugin:

## Mindmap
`$= "<iframe src='" + app.vault.adapter.getResourcePath('artifacts/mindmap/rag-patterns-2026-04-18.html') + "' width='100%' height='600'></iframe>"`

(That’s a dataviewjs snippet — adjust the artifact path.)

  • Cross-file hyperlinks between mindmaps aren’t supported. Node-level links only work for external URLs or local file paths.
  • Wikilinks render as italic labels — not clickable inside the mindmap. Use --include-wikilinks to surface them as a “Related” branch.
  • Mermaid fallback is plain markdown — no interactive pan/zoom, but renders everywhere Mermaid renders.