Major mode for working with mermaid. It's built on tree sitter, and thus requires Emacs 29 or better.
You can install mermaid-ts-mode
from MELPA.
Alternatively you can install it with straight:
(use-package mermaid-ts-mode
:defer t
:straight (:type git :host github :repo "JonathanHope/mermaid-ts-mode" :branch "main" :files ("mermaid-ts-mode.el")))
You will also need the following tree sitter grammar: https://github.com/monaqa/tree-sitter-mermaid.
- Syntax highlighting
- Indentation
- imenu
- mermaid-ts-indent-level (default 2): Indentation level
Mermaid is huge and not all of it is perfectly supported by this mode.
Flowchart support should be pretty solid.
Some of the class diagram stuff isn't well supported by the treesitter grammar.
- class notes
- class labels
- namepace
- link
- click
- callback
For some reason class members with parntheses don't indent properly.
A lot of sequence diagram stuff isn't well supported by the treesitter grammar.
- create/destroy
- box
- activate/deactivate
- loops
- alt
- parallel
- critical
- break
- rect
State diagram support should be pretty solid. Only one thing wasn't supported by treesitter grammar:
- note block
Entity Relation Diagram support should be pretty solid.
User Journeys are not supported at this time by the treesitter grammar, or this mode.
Gantt chart support should be pretty solid. Only a couple of things weren't supported by treesitter grammar:
- tick interval
- weekday
Quadrant charts are not supported at this time by the treesitter grammar, or this mode.
Requirement diagrams are not supported at this time by the treesitter grammar, or this mode.
Gitgraph diagrams are not supported at this time by the treesitter grammar, or this mode.
C4 diagrams are not supported at this time by the treesitter grammar, or this mode.
Mindmap are not supported at this time by the treesitter grammar, or this mode.
Timeline diagrams are not supported at this time by the treesitter grammar, or this mode.
ZenUML not supported at this time by the treesitter grammar, or this mode.
Sankey diagrams are not supported at this time by the treesitter grammar, or this mode.