Create Obsidian-compatible Mermaid diagrams. Prefer square layouts (TB + subgraph LR), avoid markdown in labels...
Create Mermaid diagrams that render correctly in Obsidian and publish without issues.
Activate when you need to:
λ€μ΄μ΄κ·Έλ¨μ νλμ λ€μ΄μμΌ νλ€
볡μ‘ν λ€μ΄μ΄κ·Έλ¨μ μ½κΈ° μ΄λ ΅λ€. νμ μ΅μνμ λ Έλμ μ°κ²°λ‘ ν΅μ¬λ§ νννλΌ.
Before (9κ° λ Έλ):
flowchart LR
A[μμ§] --> B[μ 리] --> C[보κ΄]
D[λͺ©ν] --> E[νμ΅] --> F[μ€ν] --> G[μΈ‘μ ] --> H[λ¬μ±]
After (2κ° λ Έλ - μμ°¨ νλ¦μ λ Έλ λ΄ ν μ€νΈλ‘):
flowchart LR
A[μμ§ β μ 리 β 보κ΄]
B[λͺ©ν β νμ΅ β μ€ν β λ¬μ±]
| νμ | μ©λ | μμ |
|---|---|---|
| ν μ΄λΈ | μμ±-κ° λ§€ν, λΉκ΅, μ΅μ | μλμ§ λ λ²¨λ³ μμ |
| Mermaid | νλ¦, νλ‘μΈμ€, νΌλλ°± 루ν | μ λ ₯βμ²λ¦¬βμΆλ ₯ |
| μΈλΌμΈ | λ¨μ μμ°¨ νλ¦ | A β B β C |
μμΉ: κ°μ μ 보λ₯Ό λ μ»΄ν©νΈνκ² νννλ νμ μ ν
Common Errors:
Node["1. First"] β "Unsupported markdown: list"
Node["Text<br/>More"] β "Unsupported markdown: heading"
Node["## Header"] β "Unsupported markdown: heading"
Correct:
Node[First]
Node[Text]
Rule: Keep labels plain text. Move complex descriptions outside the diagram.
Problem: flowchart LRμ λ무 λκ³ , flowchart TBλ λ무 κΈΈμ΄μ§λ€.
Solution: TB + λ΄λΆ LR μ‘°ν©μΌλ‘ μ μ¬κ°νμ κ°κΉμ΄ λ μ΄μμ λ§λ€κΈ°
flowchart TB
subgraph Layer1["λ μ΄μ΄ 1"]
direction LR
A[νλͺ©A] ~~~ B[νλͺ©B] ~~~ C[νλͺ©C]
end
subgraph Layer2["λ μ΄μ΄ 2"]
direction LR
D[νλͺ©D] ~~~ E[νλͺ©E]
end
Layer1 --> Layer2
ν¨ν΄:
flowchart TB: μ 체 νλ¦μ μβμλdirection LR: κ° subgraph λ΄λΆλ κ°λ‘ λ°°μΉ~~~: 보μ΄μ§ μλ μ°κ²° (νμ΄ν μμ΄ μ λ ¬μ©)Rule: μΈλ‘λ‘ λ무 κΈΈμ΄μ§λ©΄ subgraph + direction LR μ¬μ©.
β Too long:
Node["This is a very long description that will break layout"]
β
Short and clear:
Node[Short Label]
Rule: Labels should be under 15 characters. Add details in text below the diagram.
β May cause issues:
subgraph "1. Phase One"
subgraph "Phase: Setup"
β
Safe:
subgraph Phase_One["Phase One"]
subgraph Setup["Setup Phase"]
flowchart TB
A[Start] --> B{Decision}
B -->|Yes| C[Action]
B -->|No| D[End]
flowchart TB
Input[Input] --> Process[Process]
Process --> Output[Output]
Process Details:
flowchart TB
subgraph Frontend["Frontend"]
UI[UI] --> API[API Call]
end
subgraph Backend["Backend"]
Server[Server] --> DB[Database]
end
API --> Server
flowchart LR
A["1. Start<br/>with details"] --> B{"2. Decision"}
This will show "Unsupported markdown" errors.
flowchart LR
A[Very Long Process Name Here] --> B[Another Long Name] --> C[Yet Another] --> D[And More]
This gets cut off on mobile and narrow screens.
ASCII Art:
βββββββββ βββββββββ
β Start βββββββ End β
βββββββββ βββββββββ
Mermaid:
flowchart TB
Start[Start] --> End[End]
Before completing diagram creation:
<br/> tags in node labels1., 2.) in labels