A page and its PDF come from the same Markdown, so a diagram has to work in both.
In the browser a mermaid block runs through the mermaid runtime. In the PDF it is
drawn by MarkdownPDF in pure Swift, with no runtime at all, so it reads a subset of
the language. TileDown 0.12.1 widens that subset.
flowchart LR
subgraph app["Your app"]
direction TB
set["you set a value"] --> add["an animation<br/>is added"]
end
subgraph server["The render server"]
direction TB
each["each frame,<br/>works out the value"] --> draw["draws it"]
end
add --> each
What the PDF now draws
Subgraphs.
subgraph id["Title"]with its nodes andendis a titled frame around them, anddirectioninside it lays the group out left to right or top to bottom on its own. A link can join a node inside a group, a node outside, or a group.Plain, dotted and invisible links.
A --- Bjoins two nodes without an arrowhead,A -.- Bdoes the same dotted, andA ~~~ Bdraws nothing and only shapes the layout.Chains.
A --> B --> Con one line is one edge for each pair, each keeping its own label and line.Line breaks.
<br/>in a label starts a new line, where it used to be printed as text.Tall diagrams. A diagram taller than the page is shrunk, as a wide one already was, and prints its source only when it does not fit at the smallest size.
Subgraphs do not nest, and a node belongs to one group. A diagram that uses something outside the subset still prints as visible source, never a wrong picture.