Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Block diagrams

sirene draws Mermaid block diagrams (block-beta) as images and as text. Blocks fill a grid of columns in order; in text the edges are listed below the grid:

block-beta
  columns 3
  a b c
  d:2 e
the drawing of the mermaid source above

See crates/sirene-core/tests/fixtures/block/valid/ for groups, block arrows, and styles. In the editor a block diagram is read-only on the drawing side.

What is read

SyntaxDrawn as
columns 3, columns autothe columns of the diagram or group; auto (the default) is one row
a, a["Label"], a(("Label")), …a block, with the flowchart shapes
a:2a block 2 columns wide
space, space:2an empty column, or 2
a<["Label"]>(right)a block arrow pointing right, left, up, down, x (both across), or y (both up and down); several directions are allowed
block:id["Title"] … end, block … enda group of blocks with its own columns
a --> b, a -- "text" --- b, ==>, -.->an edge, drawn straight from block to block
classDef, class, stylestyles, on blocks and groups
frontmatter titlethe title above
config.block.paddingthe space between blocks (8)
accTitle, accDescrread, not drawn

Every block in a group is as large as the largest, per column it spans, as in Mermaid. Labels decode entities in both forms, &nbsp; and #nbsp;.

Errors

An unclosed block, an end with nothing to close, columns without a number, a block arrow without directions or with an unknown one, an unclosed shape or quote, and an edge without a block after it are errors. columns 0 and a width of 0 are errors and drawn as 1. A block wider than its group’s columns and a class or style for an unknown id are warnings.

Not drawn

Theme variables are ignored.