Skip to content
TileDownSite version v0.5.24

Subgraphs and more links in PDF diagrams

TileDown 0.12.1 draws Mermaid subgraphs, plain and invisible links, chained arrows and line breaks in the PDF of a page, and shrinks a tall diagram to fit instead of printing its source.

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 and end is a titled frame around them, and direction inside 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 --- B joins two nodes without an arrowhead, A -.- B does the same dotted, and A ~~~ B draws nothing and only shapes the layout.

  • Chains. A --> B --> C on 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.

TileDown Updates

Stay updated with every exciting new feature we bring to TileDown, the Markdown‑first way to build sites you truly own.

View Markdown source
index.md
---
title: Subgraphs and more links in PDF diagrams
date: 2026-11-16
description: TileDown 0.12.1 draws Mermaid subgraphs, plain and invisible links, chained arrows and line breaks in the PDF of a page, and shrinks a tall diagram to fit instead of printing its source.
tags: Release, Diagrams, Mermaid, PDF
image: /assets/post-diagrams.svg
imageDark: /assets/post-diagrams-dark.svg
---
# Subgraphs and more links in PDF diagrams

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.

```mermaid
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 and `end` is a titled frame
  around them, and `direction` inside 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 --- B` joins two nodes without an
  arrowhead, `A -.- B` does the same dotted, and `A ~~~ B` draws nothing and only
  shapes the layout.
- **Chains.** `A --> B --> C` on 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.