kieran-FENG77 downloadsWrite Mermaid diagrams without the syntax. Pick a type, fill in plain lines, insert. 22 types, live preview.
An Obsidian plugin that makes Mermaid diagrams practical: write plain lines, watch them render, insert in one click.
中文说明见 README.zh.md
```mermaid fence, it inserts only the bodyThe interface follows Obsidian's language setting. Same layout either way.
On a phone the dialog goes full screen and the type list becomes a horizontal strip:
Mermaid's parser requires ASCII identifiers. Three failures hit Chinese users constantly:
| What you type | What Mermaid says |
|---|---|
branch 内容线 in a Git graph |
Lexical error: Unrecognized text |
医生,门诊,60 in a Sankey diagram |
Expecting 'COMMA', got 'NON_ESCAPED_TEXT' |
text: 所有发布内容需经审核 in a requirement |
Lexical error |
Merchart handles all three before the parser ever sees the text:
n1, p1, t1 style ids; your Chinese goes into the label., : ; () 【】 | and friends are converted first." or [ cannot truncate the statement.One exception worth stating plainly: Sankey node names must be ASCII. Obsidian 1.15's renderer only accepts printable ASCII inside a Sankey cell, so a Chinese node name fails to parse even when quoted. When a name is not ASCII the plugin draws a flowchart version instead: same flows, values on the arrows, arrow widths scaled by volume.
You write what you mean; the plugin produces what the parser accepts.
Not in the community store yet. Manual install:
main.js, manifest.json and styles.css from the latest release.<vault>/.obsidian/plugins/merchart/.Open the inserter from the command palette (Insert diagram), the editor right-click menu, or one of the per-type commands. Pick a type on the left, type in the middle, watch it render underneath.
To revise an existing diagram you do not need a command: put the cursor inside the mermaid block and a pencil button appears on the fence line. Click it to edit. The button disappears when the cursor leaves the block.
| Key | Action |
|---|---|
Ctrl / Cmd + Enter |
Insert |
Tab |
Indent, or indent every selected line |
Shift + Tab |
Outdent |
| Drag bottom-right corner | Resize the dialog |
Sixteen take structured input; six are editable templates because their syntax is declarative. The sixteen structured ones get a Full template button next to the title, which swaps in the complete Mermaid code and back again.
| Type | Input format |
|---|---|
| Flowchart | indented lines, name{} for decisions, label: name for edge labels |
| Mindmap | indented lines, first line is the root |
| Timeline | time : event |
| Sequence | A > B : message |
| Class | Name: member, member, then A > B : label |
| State | A > B : trigger, [*] for start and end |
| ER diagram | Entity: field, field, then A > B : label |
| Gantt | task | start | duration, after some task works |
| Pie | item : value |
| Quadrant | x: low --> high, y: low --> high, then Name: 0.7, 0.3 |
| Journey | section: name, then action: score |
| Kanban | columns at the margin, cards indented |
| Treemap | root first, then name: value |
| Radar | axes: a, b, c, then Serie: 1, 2, 3 |
| Sankey | source > target : value; ASCII names give a Sankey, Chinese names fall back to a flowchart |
| XY chart | x: ... then bar: 2026, 40, 85 / line: 2025, 30, 70; a single series uses y: ... with type: bar or line |
| Git graph, C4, Requirement, Block, Packet, Architecture | editable templates |
| Setting | Default | What it does |
|---|---|---|
| Default diagram on open | Remember last | Follow the last type you used, or pin one |
| Indent width | 2 spaces | Spaces inserted by Tab |
| Close after inserting | On | Turn off to keep drawing in the same dialog |
| Add blank lines around the block | On | Keeps the fence from sticking to surrounding text |
| Live preview | On | Turn off for manual refresh on heavy diagrams |
Obsidian 1.4 or newer. On 1.15 and later Mermaid blocks render through Pele, Obsidian's own renderer, and the preview follows automatically. The plugin does not depend on which renderer is in use.
Works on desktop and mobile. On narrow screens the dialog goes full screen, the type list turns into a horizontal strip at the top, and the drag handle is hidden since there is no pointer.
npm install
npm run build # typecheck + bundle to main.js
npm run lint # run the obsidianmd rules the community review uses
npm test # 22 diagram types, 22 edge cases and 22 full templates, rendered through Pele
Every generated diagram is rendered through pele during tests, so a syntax regression fails the build instead of showing up as a broken diagram in your vault.
MIT