# Micropage

Builds a complete, styled webpage out of one URL parameter. Nothing is stored: the URL is the document, so the link is the only artefact and it can be shared, bookmarked or edited by hand. Pages carry no JavaScript.

Pick a template, then supply its slots in order. Compose the URL as /micropage?p=<template>.<theme>[.<width>][.a<accent>][.x<flags>][.l<language>]~<slot1>~<slot2>. Percent-encode each slot separately, then join with literal ~ characters. Read the encoding rules below before generating a link by hand: three of them silently corrupt content rather than erroring.

## The shape of a link

    /micropage?p=<head>~<slot>~<slot>...

Dot-separated codes, namespaced by first letter: t=template, c=theme, w=width, l=language, a=accent, x=flags. Order does not matter. Only the template code is required; everything else falls back to a default.

Everything after the first ~ is slot content, positionally matched to the slots the chosen template declares. Extra slots are ignored; missing ones are omitted from the page rather than rendered blank.

## Rules that will bite you

- Percent-encode each slot. The ~ between slots must stay literal; a tilde INSIDE content must be written %7E, or it will be read as a slot separator.
- An empty slot is two consecutive tildes.
- Never leave a literal + in content: write %2B. Some clients decode a bare + as a space, so "C++" silently becomes "C  ".
- Never leave a literal # in content: write %23. Everything after a # is a URL fragment, is never sent to the server, and is lost with no error.
- Slot content is markdown-lite: **bold**, _italic_, `code`, [label](https://url) links, and line breaks. The Article body slot also takes headings, lists, quotes and code blocks.
- Only http, https, mailto and tel links survive; any other scheme renders as plain text. Raw HTML is escaped, never rendered.
- Keep the whole link under the length limit below. It is set so every page stays QR-encodable.

## Templates

### `tar` Article

Title, standfirst, and a full markdown body.

1. `title` (inline): The h1
2. `lede` (inline): Standfirst paragraph
3. `body` (block): Markdown: headings, lists, quotes, code

Try one: https://tools.tschieber.de/micropage?p=tar.cp.wm~On%20Small%20Tools~Why%20a%20URL%20is%20enough~%23%23%20First%5Cn%5CnSome%20**prose**.

### `tev` Event

Title, when, where, details, and a link.

1. `title` (inline): The h1
2. `when` (inline): Date and time, as free text
3. `where` (inline): Location, as free text
4. `details` (block): Markdown details
5. `link` (inline): A markdown link, e.g. tickets

Try one: https://tools.tschieber.de/micropage?p=tev.cb~Release%20party~Fri%207pm~The%20Old%20Bakery~Bring%20cake.~%5BRSVP%5D(https%3A%2F%2Fexample.dev)

### `tsg` Sign

One line of text scaled to fill the page. For printing and taping to a door.

1. `text` (inline): The single line, kept short
2. `note` (inline): Smaller line beneath

Try one: https://tools.tschieber.de/micropage?p=tsg.cl.alob~BACK%20IN%2010%20MIN~Back%20by%2014%3A30

### `twf` WiFi

A network name, password, and a QR code that joins the network when scanned.

1. `network` (inline): The SSID, exactly as broadcast
2. `password` (inline): The passphrase; leave empty for an open network
3. `security` (enum: WPA | WEP | none): Encryption

Try one: https://tools.tschieber.de/micropage?p=twf.cl.asky~Guest%20WiFi~hunter2hunter2~WPA

### `tqr` QR code

A title above a large scannable QR code of a link.

1. `title` (inline): Shown above the code
2. `link` (inline): The URL the code points to

Try one: https://tools.tschieber.de/micropage?p=tqr.cl.apru~Scan%20to%20open~https%3A%2F%2Fexample.dev

## Themes

- `cl` Light: Clean light page, system sans
- `cd` Dark: Dark page, system sans
- `cm` Minimal mono: Monospace, generous whitespace
- `cp` Paper: Serif on faintly textured off-white
- `ct` Terminal: Monospace on near-black, with dashed rules
- `cb` Brutalist: Heavy rules, flat black on white

## Accents

- `alob` Lobster `#E15554`
- `arub` Ruby `#A31621`
- `aamb` Amber `#ECC30B`
- `atig` Tiger `#F18701`
- `alil` Lilac `#7768AE`
- `asky` Sky `#4D9DE0`
- `aesp` Espresso `#551B14`
- `apru` Prussian `#0A2239`
- `agry` Grey `#6B7280`

## Widths, flags and language

Widths: `ws` Small · `wm` Medium · `wl` Large · `wf` Full

Flags: `xc` Centre all text · `xb` Larger display type scale

Language: `len` English · `lde` Deutsch — sets the fixed words a template adds (When, Where, Password) and the page's lang attribute. Your own text is never translated. Default len.

## Good to know

- Slot order for a given template is fixed permanently, because a shared link has no stored record to migrate.
- The Sign template scales its text to fill the page, so it works best with a handful of words.
- The QR template renders the code server-side as inline SVG, always dark on white so it scans on any theme.

## Limits

- Whole link: 1800 characters, chosen so every micropage link stays QR-encodable
- Slots: 24
- One slot: 600 characters, or 2000 for a markdown body

## For agents and scripts

This document is the reference. The HTML version lives at https://tools.tschieber.de/micropage/docs. Every example link above works as is; copy one, replace its slots, and keep the encoding rules in mind.
