Skip to content
TileDownSite version v0.5.24

Feature Tour

Everything below is rendered by the build from ordinary Markdown. The static surfaces — math, charts, the pie, source-code color — ship as SVG and CSS with no client-side JavaScript and no web fonts. This page is the demo: view source and you will find finished output, not a runtime.

Math, typeset at build time

Write TeX in a $$…$$ block and TileDown typesets it to a self-contained SVG — real glyph outlines from Latin Modern Math, parsed in pure Swift. No MathJax, no LaTeX install, no dvisvgm. The same engine typesets to PDF.

eiπ + 1 = 0
-b ± b2 - 4ac2a

More in Math in Markdown.

Charts as static SVG

A fenced chart block becomes a static SVG at build time — zero shipped JavaScript, identical in every browser. (The numbers are invented; the rendering is real.)

Developer happiness by static site generator
bar chart with 4 labels and 1 series 0 20 40 60 80 100 TileDown Hugo Jekyll Bespoke PHP happy devs (%) This year TileDown: 92 TileDown: 92 Hugo: 71 Hugo: 71 Jekyll: 64 Jekyll: 64 Bespoke PHP: 12 Bespoke PHP: 12

When a chart needs richer hover, there is an opt-in interactive version. See Charts in Markdown and Interactive Charts.

Diagrams

A mermaid flowchart renders through the themed mermaid runtime, while a pie renders as a static SVG with no runtime at all:

graph TD
  Start[Plain Markdown] --> Build[tiledown build-site]
  Build --> SVG[Static SVG and CSS]
  Build --> HTML[Self-contained HTML]
Where the build minute goes
pie chart with 3 labels and 1 series Compiling Waiting Doom-scrolling Compiling: 3 (10%) Compiling: 3 (10%) Waiting: 1 (3.33%) Waiting: 1 (3.33%) Doom-scrolling: 26 (86.67%) Doom-scrolling: 26 (86.67%)

More in Diagrams in Markdown.

Source code, colored at build time

Fenced code is highlighted by a Swift tokenizer at build time, so the page ships colored spans and shared CSS instead of a browser highlighter. Nineteen languages are supported, Swift, Shell, Python, Rust, Go, and TypeScript among them:

struct TileDownFeature {
    let name = "static syntax highlighting"
    let shipsJavaScript = false
}
tiledown build-site content/ dist/
tiledown json content/index.md .build/home.json

See Static Code Color.

Per-article PDF

Every post on this site ships a Download PDF link. That PDF is typeset at build time from the same Markdown source as the HTML page — by the pure-Swift MarkdownPDF engine, which shares its math typesetting with the formulas above. No headless browser, no print pipeline, no server: the build writes a real, valid %PDF document, math and all, and serves it as one static file. Since 0.18.0 the PDF embeds its fonts, so the files are larger than before: the article PDFs of this site are between about 300 KB and 1.2 MB each.

Because the engine is just Swift, it also compiles to WebAssembly, so the same parser and PDF writer can run live in your browser. See The PDF engine, in your browser.

Markdown stays the canonical source

TileDown parses CommonMark through Swift Markdown. Raw HTML is escaped by design, so the source stays portable and editor-friendly.

The Markdown file remains the canonical source. The engine derives the rendered HTML, shared CSS, browser JavaScript, JSON, and feeds from that one file.

Typed references resolve at build time from tiledown.yml and the content tree:

ReferenceResolves to
page:Docs
post:Browser-Visible Tiles
tag:Tiles
link:Design notes, through an /out/ redirect

TileDown mark

Tiles: behavior on a static page

Tiles are typed content blocks. Some are pure static output, some add scoped local interactivity, and external-source tiles can connect a static page to a provider without custom JavaScript.

The callout tile is static — themed HTML and CSS, no runtime:

Static tile

A callout emits typed properties as themed HTML, with no browser runtime.

The counter tile is local — it ships a little JavaScript but needs no server:

0

The embed tile is static and provider-constrained — you keep a safe URL in Markdown and TileDown emits one responsive, sandboxed iframe with no script of its own, rewriting YouTube links to the privacy-preserving no-cookie domain:

The Buttondown tile is the first external-source tile. It emits a static signup form, posts directly to Buttondown’s embedded subscribe endpoint, and generates local redirect target pages for the confirmation flow:

TileDown Dispatch

Follow the engine as external tiles, Markdown publishing, and developer workflow support land.

Occasional developer notes. No account required.

Powered by Buttondown.

The signin tile renders members sign-in doors against a site-owned auth API: provider buttons that are plain links to the backend’s OAuth routes, plus a magic-link email form, with no tokens, cookies, or provider SDKs in the page. This demo endpoint has no backend behind it, so the doors land on a coming-soon page and a submit reports failure while keeping your input, which is the tile’s degradation contract:

The terminal tile shows a command line session as a window in the theme’s colors and font. style: manual is a window you scroll by hand (wheel, touch, or Tab and the arrow keys), with no script, and source reads the text from a file next to the page when the site is built:

build.log
$ tiledown build-site content/ dist/
reading content/index.md
reading content/docs/index.md
reading content/features/index.md
reading content/posts/first-post/index.md
warning: content/posts/first-post/index.md: link not emitted, scheme `ftp` is not allowed: ftp://example.com/file
writing dist/index.html
writing dist/docs/index.html
writing dist/features/index.html
writing dist/posts/first-post/index.html
writing dist/feed.xml
writing dist/sitemap.xml
done: 4 pages, 1 feed, 1 sitemap
$ tiledown check-links --internal dist/
ok: every internal link and anchor resolves

For a board page there are static tiles for the state of work, with no script. A pill shows a state as a word and a color, and a progress bar shows a count out of a total:

Release 0.14.0running

Checks passed 18 of 24 (75%)

The featured tile is a short list of posts picked by hand, in the order written, each with its date, its description and its picture beside the text. The titles and descriptions come from the posts themselves:

The engine has 26 tile types, and this page shows some of them. Among those not shown here: the landing tiles hero, cards (with optional icons) and cta, the kpi, timeline, flow and data tiles of a board page, the price-calculator, and the tiles of 0.17.0: collections, series, experiment, claim and claim-legend. The Docs page lists them all.

General service-form tiles still target custom service contracts that keep credentials off the client through a server-side proxy route. That hosting layer is separate from tiles like newsletter and signin, which post directly to a site-owned API. See Service Contracts Are Next.

What else the build does

View Markdown source
index.md
---
title: Feature Tour
description: A live, self-rendering tour of TileDown — math, charts, diagrams, and source-code color produced at build time from plain Markdown, plus typed tiles that add behavior to a static page.
weight: 10
image: /assets/feature-tour.svg
imageDark: /assets/feature-tour-dark.svg
---
# Feature Tour

Everything below is rendered by the build from ordinary Markdown. The static
surfaces — math, charts, the pie, source-code color — ship as SVG and CSS with
**no client-side JavaScript and no web fonts**. This page is the demo: view
source and you will find finished output, not a runtime.

## Math, typeset at build time

Write TeX in a `$$…$$` block and TileDown typesets it to a self-contained SVG —
real glyph outlines from Latin Modern Math, parsed in pure Swift. No MathJax, no
LaTeX install, no `dvisvgm`. The same engine typesets to PDF.

$$e^{i\pi} + 1 = 0$$

$$\frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$

More in [Math in Markdown](post:math-in-markdown).

## Charts as static SVG

A fenced `chart` block becomes a static SVG at build time — zero shipped
JavaScript, identical in every browser. (The numbers are invented; the rendering
is real.)

```chart
type: bar
title: Developer happiness by static site generator
categories: TileDown, Hugo, Jekyll, Bespoke PHP
y-label: happy devs (%)
series: This year = 92, 71, 64, 12
```

When a chart needs richer hover, there is an opt-in interactive version. See
[Charts in Markdown](post:charts-in-markdown) and
[Interactive Charts](post:interactive-charts).

## Diagrams

A `mermaid` flowchart renders through the themed mermaid runtime, while a `pie`
renders as a static SVG with no runtime at all:

```mermaid
graph TD
  Start[Plain Markdown] --> Build[tiledown build-site]
  Build --> SVG[Static SVG and CSS]
  Build --> HTML[Self-contained HTML]
```

```mermaid
pie title Where the build minute goes
  "Compiling" : 3
  "Waiting" : 1
  "Doom-scrolling" : 26
```

More in [Diagrams in Markdown](post:diagrams-in-markdown).

## Source code, colored at build time

Fenced code is highlighted by a Swift tokenizer at build time, so the page ships
colored spans and shared CSS instead of a browser highlighter. Nineteen
languages are supported, Swift, Shell, Python, Rust, Go, and TypeScript among
them:

```swift
struct TileDownFeature {
    let name = "static syntax highlighting"
    let shipsJavaScript = false
}
```

```sh
tiledown build-site content/ dist/
tiledown json content/index.md .build/home.json
```

See [Static Code Color](post:tiledown-0-4-1-static-code-color).

## Per-article PDF

Every post on this site ships a **Download PDF** link. That PDF is typeset at
build time from the same Markdown source as the HTML page — by the pure-Swift
MarkdownPDF engine, which shares its math typesetting with the formulas above.
No headless browser, no print pipeline, no server: the build writes a real,
valid `%PDF` document, math and all, and serves it as one static file. Since
0.18.0 the PDF embeds its fonts, so the files are larger than before: the article
PDFs of this site are between about 300 KB and 1.2 MB each.

Because the engine is just Swift, it also compiles to WebAssembly, so the same
parser and PDF writer can run live in your browser. See
[The PDF engine, in your browser](post:pdf-in-the-browser).

## Markdown stays the canonical source

TileDown parses CommonMark through Swift Markdown. Raw HTML is escaped by design,
so the source stays portable and editor-friendly.

> The Markdown file remains the canonical source. The engine derives the rendered
> HTML, shared CSS, browser JavaScript, JSON, and feeds from that one file.

Typed references resolve at build time from `tiledown.yml` and the content tree:

| Reference | Resolves to |
|:---|:---|
| `page:` | [](page:docs) |
| `post:` | [](post:browser-visible-tiles) |
| `tag:` | [](tag:Tiles) |
| `link:` | [Design notes](link:design), through an `/out/` redirect |

![TileDown mark](/assets/tiledown-mark.svg)

## Tiles: behavior on a static page

Tiles are typed content blocks. Some are pure static output, some add scoped
local interactivity, and external-source tiles can connect a static page to a
provider without custom JavaScript.

The **callout** tile is static — themed HTML and CSS, no runtime:

:::tile callout
title: Static tile
body: A callout emits typed properties as themed HTML, with no browser runtime.
:::

The **counter** tile is local — it ships a little JavaScript but needs no server:

:::tile counter
label: Press to test JavaScript
:::

The **embed** tile is static and provider-constrained — you keep a safe URL in
Markdown and TileDown emits one responsive, sandboxed iframe with no script of
its own, rewriting YouTube links to the privacy-preserving no-cookie domain:

:::tile embed
url: https://www.youtube.com/watch?v=jNQXAC9IVRw
title: The first video ever uploaded to YouTube, for scale
aspectRatio: 16/9
:::

The **Buttondown** tile is the first external-source tile. It emits a static
signup form, posts directly to Buttondown's embedded subscribe endpoint, and
generates local redirect target pages for the confirmation flow:

:::tile buttondown
username: tiledown
title: TileDown Dispatch
body: Follow the engine as external tiles, Markdown publishing, and developer workflow support land.
emailLabel: Developer email
placeholder: developer@example.com
buttonLabel: Subscribe
note: Occasional developer notes. No account required.
tags:
- tiledown
- developers
metadata.source: tiledown-site
redirectBasePath: newsletter
thanksTitle: Check your inbox
thanksBody: Buttondown has your address. Confirm the email to join TileDown Dispatch.
confirmedTitle: Subscription confirmed
confirmedBody: You are on the TileDown Dispatch list.
:::

The **signin** tile renders members sign-in doors against a site-owned auth
API: provider buttons that are plain links to the backend's OAuth routes, plus
a magic-link email form, with no tokens, cookies, or provider SDKs in the
page. This demo endpoint has no backend behind it, so the doors land on a
coming-soon page and a submit reports failure while keeping your input, which
is the tile's degradation contract:

:::tile signin
endpoint: /demo/auth
title: Members sign in (demo)
:::

The **terminal** tile shows a command line session as a window in the theme's colors and
font. `style: manual` is a window you scroll by hand (wheel, touch, or Tab and the arrow
keys), with no script, and `source` reads the text from a file next to the page when the
site is built:

:::tile terminal
style: manual
lines: 6
source: build.log
title: build.log
:::

For a board page there are static tiles for the state of work, with no script. A **pill**
shows a state as a word and a color, and a **progress** bar shows a count out of a total:

:::tile pill
status: running
label: Release 0.14.0
:::

:::tile progress
value: 18
max: 24
label: Checks passed
status: running
:::

The **featured** tile is a short list of posts picked by hand, in the order written, each
with its date, its description and its picture beside the text. The titles and descriptions
come from the posts themselves:

:::tile featured
heading: Three posts to start with
headingLevel: 3
post: math-in-markdown
note: Formulas typeset to SVG when the site is built.
post: charts-in-markdown
post: diagrams-in-markdown
:::

The engine has 26 tile types, and this page shows some of them. Among those not shown here: the
landing tiles **hero**, **cards** (with optional icons) and **cta**, the **kpi**,
**timeline**, **flow** and **data** tiles of a board page, the **price-calculator**, and
the tiles of 0.17.0: **collections**, **series**, **experiment**, **claim** and
**claim-legend**. The [](page:docs) page lists them all.

General **service-form** tiles still target custom service contracts that keep
credentials off the client through a server-side proxy route. That hosting layer
is separate from tiles like `newsletter` and `signin`, which post directly to a
site-owned API. See [Service Contracts Are Next](post:service-contracts).

## What else the build does

- **Theme-aware images** — pair `image` with `imageDark` in front matter; layouts switch hero and card art with the page theme.
- **RSS** — a feed is generated from the dated posts.
- **Tag AND filtering** — generated tag pages are static URLs; start at [Markdown](/tags/markdown/) and narrow to [Markdown AND Swift](/tags/markdown/swift/).
- **Outbound redirect shims** — configured links route through `/out/` pages.
- **Table of contents**: `toc: true` in front matter anchors the `h2` and `h3` headings and puts a list of links to them first.
- **Picture text alternative**: `imageAlt` in front matter is the text alternative of the page's picture on the hero, on the post card and in the sharing metadata.
- **Title size and width**: `titleSize`, `homeTitleSize`, `titleWidth` and `homeTitleWidth` in `tiledown.yml` set the page title, as relative CSS lengths.
- **Tag bar limit**: `tagBarLimit` shows the most used tags with their counts and keeps the rest behind a disclosure.
- **Diagram colours**: `theme.light.diagrams: tokens` and `theme.dark.diagrams: tokens` draw Mermaid diagrams in the theme's colours.
- **Embedded PDF fonts**: an article PDF embeds its DejaVu Sans faces, so bold and letter spacing look the same in every viewer.
- **Groups of posts** (0.17.0): sections, collections and series, declared in `tiledown.yml`, each with its pages; a section and a collection can have a feed of their own, and the `collections` and `series` tiles show them on any page.
- **Claim markers and the experiment tile** (0.17.0): `[claim:measured]` at the start of a sentence says what kind of claim it makes, and an `experiment` tile says in one box how to repeat a measurement.
- **Log line highlighting** (0.17.0): `rules` or `preset: event-log` in a `terminal` tile styles the parts of each log line.
- **Accessibility checks** (0.18.0): every page starts with a skip link, and `tiledown doctor --publish` reports pictures with no text alternative, heading order, vague link text, unnamed form controls and buttons, a missing page language and tables with no header cell.
- **Drafts excluded** — `draft: true` pages stay out of the published output.