Skip to content
TileDownSite version v0.5.24

Docs

TileDown is a Swift package under Packages/ of its repository. The library module is TileKit (import TileKit), its types live under Tiledown, and the CLI is tiledown.

The written reference is in that repository: authoring.md (front matter and every tile), config-reference.md (every tiledown.yml key) and getting-started.md (the commands).

Build this website

From the root of the website repository, TileDownHQ/tiledown.com, with a checkout of the engine beside it or named by TILEDOWN_REPO:

scripts/build.sh
scripts/check.sh

The first command writes the generated site to .build/website. The second command builds it, serves it locally, and runs Playwright checks against the generated pages. These two scripts belong to the website, not to the engine.

CLI surface

tiledown help
tiledown version
tiledown build source.md template.html out.html
tiledown build-site content/ dist/
tiledown build-site content/ dist/ --drafts
tiledown serve --port 8765 content/
tiledown doctor --publish content/
tiledown doctor --publish --keep-temp content/
tiledown check-links --internal dist/
tiledown json content/index.md .build/home.json
tiledown fmt --check content/index.md

--drafts (for build-site, serve and doctor) keeps the draft pages, for a preview. check-links requests every external link of Markdown files, HTML files or a built site and reports each one; it is the only command that uses the network. doctor --keep-temp keeps the build it made and reports the folder, which is under the folder TMPDIR names.

What the publish check reports

Since 0.18.0 tiledown doctor --publish checks accessibility in the source and in every built page:

FindingWhat it means
a11y.alt-missingA picture with no text alternative. A picture that is decoration on purpose is written with an empty text and the title decorative: ![](line.png "decorative").
a11y.heading-orderA heading more than one level deeper than the one before it, a second level-one heading, or a page with no level-one heading.
a11y.link-textA link with no text, or whose whole text is a vague phrase such as here or read more.
a11y.form-labelA form control with no accessible name. A placeholder is not a name.
a11y.button-nameA button with no text and no aria-label.
a11y.langA page with no language on its html element.
a11y.skip-linkA page with no skip link first in its body, or one whose target is missing.
a11y.table-headerA table with no header cell.

Every page the build makes starts with a skip link (“Skip to content”), out of sight until it takes the keyboard focus, and the theme toggle says whether the dark appearance is on (aria-pressed).

Current status

AreaStatus
Markdown parsingCommonMark plus a constrained profile
Built-in layoutstop navigation and left sidebar
Postsdated posts, latest posts, RSS, tags, draft exclusion; order in front matter orders posts of the same date
Groups of postssections, collections and series, declared in tiledown.yml, with their pages; a section and a collection can have a feed of their own
Source codebuild-time syntax highlighting, including Markdown source disclosure
Themesstandard, system and editorial, with light/dark support; editorial tables have a wide measure, a sticky header and stripes. Since 0.18.0 two light syntax colours of the editorial theme, the number and the comment, are darker so that they pass 4.5 to 1
Tiles26 types: callout, hero, cards, cta, counter, embed, chart, mermaid, price-calculator, buttondown, newsletter, signin, terminal (also a live log), pill, progress, kpi, timeline, flow, data, collections, series, featured, experiment, claim, claim-legend, and service-form
SettingstitleSize, homeTitleSize, titleWidth, homeTitleWidth, tagBarLimit, theme.light.diagrams and theme.dark.diagrams in tiledown.yml; imageAlt in front matter; versionLabel, footer.engine, footer.engineText and footer.engineURL for the version line and the engine line of the footer; claimLegend for the page that explains claim markers
Pagestoc: true in front matter adds a table of contents of the h2 and h3 headings
Article PDFwith articlePDF: true every article gets a PDF made from its Markdown. Since 0.18.0 the PDF embeds its fonts (DejaVu Sans) and is a tagged PDF; no PDF/UA conformance is claimed. A page whose PDF cannot be made is reported as the warning pdf.render-failed
CLI diagnosticshelp, serve, check-links, and doctor checks for content directories, with the accessibility findings of doctor --publish
External formsthe buttondown tile posts directly to Buttondown, the newsletter and signin tiles post to site-owned APIs; proxied service contracts remain future hosting work
Live publishingCodeberg Pages serves the generated site artifact
PlatformsmacOS and Linux build and test gates; the package also declares iOS 17

Terminal tile

:::tile terminal
style: manual
lines: 20
source: board.log
tail: 500
title: board.log
:::
PropertyWhat it does
text or sourceThe session as a block, or a file next to the page read at build time (not both).
stylestill (default), scroll (CSS scrolling, pauses under the pointer) or manual (scrolled by wheel, touch or keyboard, newest line at the bottom).
linesWith scroll or manual, the lines shown, 3 to 60 (default 16).
wrapWith manual, true wraps long lines; false scrolls them sideways.
tailWith source, keep the last 1 to 100000 lines.
max-bytesWith source, keep at most this many bytes from the end, 1 to 16777216 (default 262144).
titleThe title bar (default: the first command).
rulesSince 0.17.0: a block of ordered rules, each a regular expression with named groups and the styles of its groups, to highlight the parts of a log line. foldwidth in a rule, with fold=true, is how many characters of a folded group show (1 to 200, three without it).
presetSince 0.17.0: the name of a built-in set of rules, event-log.

Color codes in the text become the theme’s colors, and \e stands for the escape character. The full reference is “Terminal tile” in docs/authoring.md.

With live: true (with source and style: manual) the window follows the file while the page is open, served by tiledown serve; a site deployed as static files shows the lines of the build. This is measured in Chromium, and Safari and Firefox are unverified.

Board tiles

The pill, progress, kpi, timeline and flow tiles are static markup and CSS with no script, for a board page. A data tile reads a JSON file at build time and becomes any of them: source is the file, at names the key of a JSON object that holds the array of rows, as is kpi, timeline, flow, pill or progress, and the mapping lines name the key of each row that holds each line. pill and progress are one tile for each row. The full reference is “Data tile” and “A board page” in docs/authoring.md.

Featured tile

:::tile featured
heading: Start here
post: math-in-markdown
note: The shortest way to see what the build does.
post: charts-in-markdown
style: list
:::
LineWhat it does
postA post of the site, by the key a [text](post:key) link takes. Repeat it for each post; the order written is the order shown.
noteOne line about the post above it. Optional.
headingA heading over the list. Optional.
headingLevelThe level of that heading: 2 (default), 3 or 4.
stylelist (default, a numbered list) or cards.

Each post shows its title as a link, its date, its description and, when it has one, its picture beside the text. A key that names no post, a draft or a post named twice stops the build. The tile is new in 0.18.0.

Groups of posts and the tiles of 0.17.0

A site can group its posts in three ways, each declared with flat lines in tiledown.yml:

GroupDeclared byWhat the build makes
Sectionsection.<key>.dir, with optional label, feed and allowedTagsThe dated posts under that directory are the section’s, kept out of the main feed and the main post lists; feed writes the section’s own feed.
Collectioncollection.<key>.title, and collection: <key> in a post’s front matterA page at /collections/<key>/, a list of collections at /collections/ and a feed for each collection.
Seriesseries.<key>.title, .description and one .post line for each part, in reading orderA page at /series/<key>/, a list at /series/, and on each part a box with the previous and the next part.

Five tiles came with them:

TileWhat it shows
collectionsEvery collection of the site as a card. Lines, all optional: columns (1 to 4), heading, width.
seriesOne series as an ordered list on any page. Lines: key, and optionally heading.
experimentHow to repeat a measurement, in one box: machine, system, repository, commit, data, command, date, notYet, title, open.
claimA paragraph marked with the kind of claim it makes, with a longer source line. In running text the marker is [claim:measured] at the start of a sentence, with one of five words: measured, derived, inferred, documented, unverified.
claim-legendThe explanation of the five words. claimLegend in tiledown.yml names the page that carries it.

A card of the cards tile can carry an icon: icon (the name of a built-in icon), iconFile (an SVG file next to the page) and iconLabel (its text alternative).

The full reference is “Collections”, “Series”, “Claim status markers”, “Experiment tile” and “Card icons” in docs/authoring.md, and “Groups of posts” in docs/config-reference.md.

Title, tag bar and picture settings

KeyWhereWhat it does
titleSizetiledown.ymlThe size of the title (the first-level heading) of every page, for example clamp(1.9rem, 3.4vw, 2.6rem). Relative units only.
homeTitleSizetiledown.ymlThe same for the home page title. Needs baseURL.
titleWidthtiledown.ymlThe widest a page title line may be, for example 24ch. Relative units only.
homeTitleWidthtiledown.ymlThe same for the home page title. Needs baseURL.
tagBarLimittiledown.ymlHow many tags the tag bar shows, the most used first, each with its count; the rest stay behind a disclosure. 0 (default) shows every tag.
theme.light.diagrams, theme.dark.diagramstiledown.ymltokens draws Mermaid diagrams in the theme’s own colours.
imageAltfront matterThe text alternative of the page’s picture: on the hero, the post card and the sharing metadata. Without it the page title stands in.

The full reference of these settings is docs/config-reference.md (the tiledown.yml keys) and docs/authoring.md (imageAlt).

Tables and the table of contents

In the editorial theme a table has a wide measure of its own (--td-measure-wide, 72rem by default), a sticky header row, hairlines with a faint stripe and an ink rule under the last row; under 48rem it goes back to the column and scrolls sideways. toc: true in a page’s front matter anchors its h2 and h3 headings and puts a list of links to them first; a page with fewer than two such headings gets no list.

Architecture

The design documents are part of the repository:

The package is split into small targets: core product metadata, source parsing, tile parsing, Markdown rendering, output rendering, site generation, service contracts, service-form rendering, and the facade used by the CLI.

View Markdown source
index.md
---
title: Docs
description: Current commands, architecture, and status for TileDown.
weight: 20
image: /assets/docs-preview.svg
imageDark: /assets/docs-preview-dark.svg
---
# Docs

TileDown is a Swift package under `Packages/` of
[its repository](https://codeberg.org/TileDownHQ/tile-down). The library module is
`TileKit` (`import TileKit`), its types live under `Tiledown`, and the CLI is `tiledown`.

The written reference is in that repository:
[authoring.md](https://codeberg.org/TileDownHQ/tile-down/src/branch/main/docs/authoring.md)
(front matter and every tile),
[config-reference.md](https://codeberg.org/TileDownHQ/tile-down/src/branch/main/docs/config-reference.md)
(every `tiledown.yml` key) and
[getting-started.md](https://codeberg.org/TileDownHQ/tile-down/src/branch/main/docs/getting-started.md)
(the commands).

## Build this website

From the root of the website repository,
[TileDownHQ/tiledown.com](https://codeberg.org/TileDownHQ/tiledown.com), with a checkout
of the engine beside it or named by `TILEDOWN_REPO`:

```sh
scripts/build.sh
scripts/check.sh
```

The first command writes the generated site to `.build/website`. The second
command builds it, serves it locally, and runs Playwright checks against the
generated pages. These two scripts belong to the website, not to the engine.

## CLI surface

```sh
tiledown help
tiledown version
tiledown build source.md template.html out.html
tiledown build-site content/ dist/
tiledown build-site content/ dist/ --drafts
tiledown serve --port 8765 content/
tiledown doctor --publish content/
tiledown doctor --publish --keep-temp content/
tiledown check-links --internal dist/
tiledown json content/index.md .build/home.json
tiledown fmt --check content/index.md
```

`--drafts` (for `build-site`, `serve` and `doctor`) keeps the draft pages, for a preview.
`check-links` requests every external link of Markdown files, HTML files or a built site
and reports each one; it is the only command that uses the network. `doctor --keep-temp`
keeps the build it made and reports the folder, which is under the folder `TMPDIR` names.

## What the publish check reports

Since 0.18.0 `tiledown doctor --publish` checks accessibility in the source and in every
built page:

| Finding | What it means |
|:---|:---|
| `a11y.alt-missing` | A picture with no text alternative. A picture that is decoration on purpose is written with an empty text and the title `decorative`: `![](line.png "decorative")`. |
| `a11y.heading-order` | A heading more than one level deeper than the one before it, a second level-one heading, or a page with no level-one heading. |
| `a11y.link-text` | A link with no text, or whose whole text is a vague phrase such as `here` or `read more`. |
| `a11y.form-label` | A form control with no accessible name. A placeholder is not a name. |
| `a11y.button-name` | A button with no text and no `aria-label`. |
| `a11y.lang` | A page with no language on its `html` element. |
| `a11y.skip-link` | A page with no skip link first in its body, or one whose target is missing. |
| `a11y.table-header` | A table with no header cell. |

Every page the build makes starts with a skip link ("Skip to content"), out of sight
until it takes the keyboard focus, and the theme toggle says whether the dark
appearance is on (`aria-pressed`).

## Current status

| Area | Status |
|:---|:---|
| Markdown parsing | CommonMark plus a constrained profile |
| Built-in layouts | top navigation and left sidebar |
| Posts | dated posts, latest posts, RSS, tags, draft exclusion; `order` in front matter orders posts of the same date |
| Groups of posts | sections, collections and series, declared in `tiledown.yml`, with their pages; a section and a collection can have a feed of their own |
| Source code | build-time syntax highlighting, including Markdown source disclosure |
| Themes | standard, system and editorial, with light/dark support; editorial tables have a wide measure, a sticky header and stripes. Since 0.18.0 two light syntax colours of the editorial theme, the number and the comment, are darker so that they pass 4.5 to 1 |
| Tiles | 26 types: callout, hero, cards, cta, counter, embed, chart, mermaid, price-calculator, buttondown, newsletter, signin, terminal (also a live log), pill, progress, kpi, timeline, flow, data, collections, series, featured, experiment, claim, claim-legend, and service-form |
| Settings | `titleSize`, `homeTitleSize`, `titleWidth`, `homeTitleWidth`, `tagBarLimit`, `theme.light.diagrams` and `theme.dark.diagrams` in `tiledown.yml`; `imageAlt` in front matter; `versionLabel`, `footer.engine`, `footer.engineText` and `footer.engineURL` for the version line and the engine line of the footer; `claimLegend` for the page that explains claim markers |
| Pages | `toc: true` in front matter adds a table of contents of the `h2` and `h3` headings |
| Article PDF | with `articlePDF: true` every article gets a PDF made from its Markdown. Since 0.18.0 the PDF embeds its fonts (DejaVu Sans) and is a tagged PDF; no PDF/UA conformance is claimed. A page whose PDF cannot be made is reported as the warning `pdf.render-failed` |
| CLI diagnostics | help, serve, check-links, and doctor checks for content directories, with the accessibility findings of `doctor --publish` |
| External forms | the buttondown tile posts directly to Buttondown, the newsletter and signin tiles post to site-owned APIs; proxied service contracts remain future hosting work |
| Live publishing | Codeberg Pages serves the generated site artifact |
| Platforms | macOS and Linux build and test gates; the package also declares iOS 17 |

## Terminal tile

```
:::tile terminal
style: manual
lines: 20
source: board.log
tail: 500
title: board.log
:::
```

| Property | What it does |
|:---|:---|
| `text` or `source` | The session as a block, or a file next to the page read at build time (not both). |
| `style` | `still` (default), `scroll` (CSS scrolling, pauses under the pointer) or `manual` (scrolled by wheel, touch or keyboard, newest line at the bottom). |
| `lines` | With `scroll` or `manual`, the lines shown, 3 to 60 (default 16). |
| `wrap` | With `manual`, `true` wraps long lines; `false` scrolls them sideways. |
| `tail` | With `source`, keep the last 1 to 100000 lines. |
| `max-bytes` | With `source`, keep at most this many bytes from the end, 1 to 16777216 (default 262144). |
| `title` | The title bar (default: the first command). |
| `rules` | Since 0.17.0: a block of ordered rules, each a regular expression with named groups and the styles of its groups, to highlight the parts of a log line. `foldwidth` in a rule, with `fold=true`, is how many characters of a folded group show (1 to 200, three without it). |
| `preset` | Since 0.17.0: the name of a built-in set of rules, `event-log`. |

Color codes in the text become the theme's colors, and `\e` stands for the escape
character. The full reference is "Terminal tile" in `docs/authoring.md`.

With `live: true` (with `source` and `style: manual`) the window follows the file while
the page is open, served by `tiledown serve`; a site deployed as static files shows the
lines of the build. This is measured in Chromium, and Safari and Firefox are unverified.

## Board tiles

The `pill`, `progress`, `kpi`, `timeline` and `flow` tiles are static markup and CSS with
no script, for a board page. A `data` tile reads a JSON file at build time and becomes any
of them: `source` is the file, `at` names the key of a JSON object that holds the array
of rows, `as` is `kpi`, `timeline`, `flow`, `pill` or `progress`, and the mapping lines
name the key of each row that holds each line. `pill` and `progress` are one tile for each
row. The full reference is "Data tile" and "A board page" in `docs/authoring.md`.

## Featured tile

```
:::tile featured
heading: Start here
post: math-in-markdown
note: The shortest way to see what the build does.
post: charts-in-markdown
style: list
:::
```

| Line | What it does |
|:---|:---|
| `post` | A post of the site, by the key a `[text](post:key)` link takes. Repeat it for each post; the order written is the order shown. |
| `note` | One line about the post above it. Optional. |
| `heading` | A heading over the list. Optional. |
| `headingLevel` | The level of that heading: 2 (default), 3 or 4. |
| `style` | `list` (default, a numbered list) or `cards`. |

Each post shows its title as a link, its date, its description and, when it has one, its
picture beside the text. A key that names no post, a draft or a post named twice stops the
build. The tile is new in 0.18.0.

## Groups of posts and the tiles of 0.17.0

A site can group its posts in three ways, each declared with flat lines in `tiledown.yml`:

| Group | Declared by | What the build makes |
|:---|:---|:---|
| Section | `section.<key>.dir`, with optional `label`, `feed` and `allowedTags` | The dated posts under that directory are the section's, kept out of the main feed and the main post lists; `feed` writes the section's own feed. |
| Collection | `collection.<key>.title`, and `collection: <key>` in a post's front matter | A page at `/collections/<key>/`, a list of collections at `/collections/` and a feed for each collection. |
| Series | `series.<key>.title`, `.description` and one `.post` line for each part, in reading order | A page at `/series/<key>/`, a list at `/series/`, and on each part a box with the previous and the next part. |

Five tiles came with them:

| Tile | What it shows |
|:---|:---|
| `collections` | Every collection of the site as a card. Lines, all optional: `columns` (1 to 4), `heading`, `width`. |
| `series` | One series as an ordered list on any page. Lines: `key`, and optionally `heading`. |
| `experiment` | How to repeat a measurement, in one box: `machine`, `system`, `repository`, `commit`, `data`, `command`, `date`, `notYet`, `title`, `open`. |
| `claim` | A paragraph marked with the kind of claim it makes, with a longer source line. In running text the marker is `[claim:measured]` at the start of a sentence, with one of five words: `measured`, `derived`, `inferred`, `documented`, `unverified`. |
| `claim-legend` | The explanation of the five words. `claimLegend` in `tiledown.yml` names the page that carries it. |

A card of the `cards` tile can carry an icon: `icon` (the name of a built-in icon),
`iconFile` (an SVG file next to the page) and `iconLabel` (its text alternative).

The full reference is "Collections", "Series", "Claim status markers", "Experiment tile"
and "Card icons" in `docs/authoring.md`, and "Groups of posts" in
`docs/config-reference.md`.

## Title, tag bar and picture settings

| Key | Where | What it does |
|:---|:---|:---|
| `titleSize` | `tiledown.yml` | The size of the title (the first-level heading) of every page, for example `clamp(1.9rem, 3.4vw, 2.6rem)`. Relative units only. |
| `homeTitleSize` | `tiledown.yml` | The same for the home page title. Needs `baseURL`. |
| `titleWidth` | `tiledown.yml` | The widest a page title line may be, for example `24ch`. Relative units only. |
| `homeTitleWidth` | `tiledown.yml` | The same for the home page title. Needs `baseURL`. |
| `tagBarLimit` | `tiledown.yml` | How many tags the tag bar shows, the most used first, each with its count; the rest stay behind a disclosure. `0` (default) shows every tag. |
| `theme.light.diagrams`, `theme.dark.diagrams` | `tiledown.yml` | `tokens` draws Mermaid diagrams in the theme's own colours. |
| `imageAlt` | front matter | The text alternative of the page's picture: on the hero, the post card and the sharing metadata. Without it the page title stands in. |

The full reference of these settings is `docs/config-reference.md` (the `tiledown.yml`
keys) and `docs/authoring.md` (`imageAlt`).

## Tables and the table of contents

In the `editorial` theme a table has a wide measure of its own (`--td-measure-wide`, 72rem
by default), a sticky header row, hairlines with a faint stripe and an ink rule under the
last row; under 48rem it goes back to the column and scrolls sideways. `toc: true` in a
page's front matter anchors its `h2` and `h3` headings and puts a list of links to them
first; a page with fewer than two such headings gets no list.

## Architecture

The design documents are part of the repository:

- [Design snapshot](link:design)
- [Open issues](link:issues)
- [Repository](link:repo)

The package is split into small targets: core product metadata, source parsing,
tile parsing, Markdown rendering, output rendering, site generation, service
contracts, service-form rendering, and the facade used by the CLI.