{
  "version": 2,
  "summary": "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.",
  "howToUse": "Pick a template, then supply its slots in order. Compose the URL as /micropage?p=<template>.<theme>[.<width>][.a<accent>][.x<flags>]~<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.",
  "grammar": {
    "shape": "/micropage?p=<head>~<slot>~<slot>...",
    "head": "Dot-separated codes, namespaced by first letter: t=template, c=theme, w=width, a=accent, x=flags. Order does not matter. Only the template code is required; everything else falls back to a default.",
    "slots": "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": [
      "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."
    ]
  },
  "notes": [
    "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": {
    "maxQueryLength": 1800,
    "maxSlots": 24,
    "maxInlineSlot": 600,
    "maxBlockSlot": 2000,
    "maxRenderedBytes": 65536
  },
  "templates": [
    {
      "code": "tar",
      "name": "Article",
      "description": "Title, standfirst, and a full markdown body.",
      "slots": [
        {
          "name": "title",
          "kind": "inline",
          "description": "The h1"
        },
        {
          "name": "lede",
          "kind": "inline",
          "description": "Standfirst paragraph"
        },
        {
          "name": "body",
          "kind": "block",
          "description": "Markdown: headings, lists, quotes, code"
        }
      ],
      "example": "https://tools.tschieber.de/micropage?p=tar.cp.wm~On%20Small%20Tools~Why%20a%20URL%20is%20enough~%23%23%20First%5Cn%5CnSome%20**prose**."
    },
    {
      "code": "tev",
      "name": "Event",
      "description": "Title, when, where, details, and a link.",
      "slots": [
        {
          "name": "title",
          "kind": "inline",
          "description": "The h1"
        },
        {
          "name": "when",
          "kind": "inline",
          "description": "Date and time, as free text"
        },
        {
          "name": "where",
          "kind": "inline",
          "description": "Location, as free text"
        },
        {
          "name": "details",
          "kind": "block",
          "description": "Markdown details"
        },
        {
          "name": "link",
          "kind": "inline",
          "description": "A markdown link, e.g. tickets"
        }
      ],
      "example": "https://tools.tschieber.de/micropage?p=tev.cb~Release%20party~Fri%207pm~The%20Old%20Bakery~Bring%20cake.~%5BRSVP%5D(https%3A%2F%2Fexample.dev)"
    },
    {
      "code": "tsg",
      "name": "Sign",
      "description": "One line of text scaled to fill the page. For printing and taping to a door.",
      "slots": [
        {
          "name": "text",
          "kind": "inline",
          "description": "The single line, kept short"
        },
        {
          "name": "note",
          "kind": "inline",
          "description": "Smaller line beneath"
        }
      ],
      "example": "https://tools.tschieber.de/micropage?p=tsg.cl.alob~BACK%20IN%2010%20MIN~Back%20by%2014%3A30"
    },
    {
      "code": "twf",
      "name": "WiFi",
      "description": "A network name, password, and a QR code that joins the network when scanned.",
      "slots": [
        {
          "name": "network",
          "kind": "inline",
          "description": "The SSID, exactly as broadcast"
        },
        {
          "name": "password",
          "kind": "inline",
          "description": "The passphrase; leave empty for an open network"
        },
        {
          "name": "security",
          "kind": "enum",
          "description": "Encryption",
          "values": [
            "WPA",
            "WEP",
            "none"
          ]
        }
      ],
      "example": "https://tools.tschieber.de/micropage?p=twf.cl.asky~Guest%20WiFi~hunter2hunter2~WPA"
    },
    {
      "code": "tqr",
      "name": "QR code",
      "description": "A title above a large scannable QR code of a link.",
      "slots": [
        {
          "name": "title",
          "kind": "inline",
          "description": "Shown above the code"
        },
        {
          "name": "link",
          "kind": "inline",
          "description": "The URL the code points to"
        }
      ],
      "example": "https://tools.tschieber.de/micropage?p=tqr.cl.apru~Scan%20to%20open~https%3A%2F%2Fexample.dev"
    }
  ],
  "themes": [
    {
      "code": "cl",
      "name": "Light",
      "description": "Clean light page, system sans"
    },
    {
      "code": "cd",
      "name": "Dark",
      "description": "Dark page, system sans"
    },
    {
      "code": "cm",
      "name": "Minimal mono",
      "description": "Monospace, generous whitespace"
    },
    {
      "code": "cp",
      "name": "Paper",
      "description": "Serif on faintly textured off-white"
    },
    {
      "code": "ct",
      "name": "Terminal",
      "description": "Monospace on near-black, with dashed rules"
    },
    {
      "code": "cb",
      "name": "Brutalist",
      "description": "Heavy rules, flat black on white"
    }
  ],
  "widths": [
    {
      "code": "ws",
      "name": "Small"
    },
    {
      "code": "wm",
      "name": "Medium"
    },
    {
      "code": "wl",
      "name": "Large"
    },
    {
      "code": "wf",
      "name": "Full"
    }
  ],
  "accents": [
    {
      "code": "alob",
      "name": "Lobster",
      "hex": "#E15554",
      "textOn": "#141414"
    },
    {
      "code": "arub",
      "name": "Ruby",
      "hex": "#A31621",
      "textOn": "#ffffff"
    },
    {
      "code": "aamb",
      "name": "Amber",
      "hex": "#ECC30B",
      "textOn": "#141414"
    },
    {
      "code": "atig",
      "name": "Tiger",
      "hex": "#F18701",
      "textOn": "#141414"
    },
    {
      "code": "alil",
      "name": "Lilac",
      "hex": "#7768AE",
      "textOn": "#ffffff"
    },
    {
      "code": "asky",
      "name": "Sky",
      "hex": "#4D9DE0",
      "textOn": "#141414"
    },
    {
      "code": "aesp",
      "name": "Espresso",
      "hex": "#551B14",
      "textOn": "#ffffff"
    },
    {
      "code": "apru",
      "name": "Prussian",
      "hex": "#0A2239",
      "textOn": "#ffffff"
    },
    {
      "code": "agry",
      "name": "Grey",
      "hex": "#6B7280",
      "textOn": "#ffffff"
    }
  ],
  "flags": [
    {
      "code": "xc",
      "name": "Center",
      "description": "Centre all text"
    },
    {
      "code": "xb",
      "name": "Big",
      "description": "Larger display type scale"
    }
  ]
}