Blocks

Compatibility: GitHub, GitLab, Obsidian, Notion

A fenced block is three backticks with a name after them. For code that name is the language and the block shows as highlighted text. For a diagram the name is the diagram type, and the block renders as a picture wherever that block type is supported. Mermaid, for example, renders on GitHub, GitLab and Notion. You write the diagram once as text and it travels with your document.

You write
```mermaid
flowchart LR
  Start --> Stop
```
You get
Start Stop

Block types

The name after the opening fence sets the block type. These are the diagram block types, including ones we do not build an editor for yet.

Block Type Editor
Available now
```mermaidMermaid diagramsSee types below
```dotGraphviz graph / networkOpen
```vega-liteVega-Lite data chartOpen
```wavedromWaveDrom waveformOpen
```bpmnBPMN processOpen
```railroadRailroad / syntaxOpen
```smilesChemical structure (SMILES)Open
```abcMusic notation (ABC)Open
Known, not yet supported
```plantumlPlantUML (UML, C4 and more)
```d2D2 diagrams
```nomnomlNomnoml (UML)
```markmapMarkmap (mind map)
```ditaaditaa (ASCII art to image)
```blockdiagblockdiag family (seq, act, nw)
```pikchrPikchr
```svgbobSvgbob (ASCII to SVG)
```vegaVega (full spec)
```tikzTikZ / PGF
```mathMaths (LaTeX / KaTeX)

Mermaid diagram types

Mermaid packs many diagrams into the one ```mermaid block. You choose which by the first line inside the block. These are the first lines.

First line Diagram Editor
Available now
flowchart TDFlowchartOpen
sequenceDiagramSequence diagramOpen
classDiagramClass (UML) diagramOpen
stateDiagram-v2State diagramOpen
erDiagramER / database diagramOpen
ganttGantt chartOpen
timelineTimelineOpen
mindmapMind mapOpen
journeyUser journeyOpen
gitGraphGit graphOpen
requirementDiagramRequirement diagramOpen
kanbanKanban boardOpen
architecture-betaArchitecture diagramOpen
piePie chartOpen
quadrantChartQuadrant chartOpen
sankey-betaSankey diagramOpen
xychart-betaXY / bar / line chartOpen
Known, not yet supported
C4ContextC4 architecture
block-betaBlock diagram
packet-betaPacket diagram
zenumlZenUML sequence