From a13e6b40ce0e9252468682843135c908dab8f1e3 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Mon, 19 Oct 2026 16:24:23 +0200 Subject: [PATCH] Website: a documentation section for the whole project, replacing the server page /docs has a left navigation and eleven pages written for players first, then hosters, then contributors: what Horizon is, install, settings, multiplayer, logs and bug reports, hosting (the launcher's Servers page and the command line), modpacks, mods and data packs, performance, contributing and the FAQ. /server redirects to /docs/hosting. The build checks every link between the pages and every image. Co-Authored-By: Claude Opus 5.5 --- website/Caddyfile | 8 +- website/Dockerfile | 1 + website/LEGAL.md | 11 +- website/README.md | 21 ++- website/build.mjs | 106 ++++++++++-- website/docs/contributing.md | 56 ++++++ website/docs/faq.md | 71 ++++++++ website/docs/hosting.md | 162 ++++++++++++++++++ website/docs/index.md | 33 ++++ website/docs/install.md | 50 ++++++ website/docs/modpacks.md | 48 ++++++ website/docs/mods.md | 46 +++++ website/docs/multiplayer.md | 41 +++++ website/docs/nav.json | 7 + website/docs/performance.md | 50 ++++++ website/docs/settings.md | 72 ++++++++ website/docs/troubleshooting.md | 55 ++++++ .../public/media/docs/servers-backups.webp | Bin 0 -> 26474 bytes website/public/media/docs/servers-create.webp | Bin 0 -> 23592 bytes .../public/media/docs/servers-dashboard.webp | Bin 0 -> 35428 bytes website/public/media/docs/servers-invite.webp | Bin 0 -> 40448 bytes website/public/sitemap.xml | 6 - website/serve.mjs | 10 +- website/src/docs.html | 63 +++++++ website/src/index.html | 6 +- website/src/markdown.js | 52 ++++-- website/src/server.html | 31 ---- website/src/style.css | 68 ++++++++ 28 files changed, 1000 insertions(+), 74 deletions(-) create mode 100644 website/docs/contributing.md create mode 100644 website/docs/faq.md create mode 100644 website/docs/hosting.md create mode 100644 website/docs/index.md create mode 100644 website/docs/install.md create mode 100644 website/docs/modpacks.md create mode 100644 website/docs/mods.md create mode 100644 website/docs/multiplayer.md create mode 100644 website/docs/nav.json create mode 100644 website/docs/performance.md create mode 100644 website/docs/settings.md create mode 100644 website/docs/troubleshooting.md create mode 100644 website/public/media/docs/servers-backups.webp create mode 100644 website/public/media/docs/servers-create.webp create mode 100644 website/public/media/docs/servers-dashboard.webp create mode 100644 website/public/media/docs/servers-invite.webp delete mode 100644 website/public/sitemap.xml create mode 100644 website/src/docs.html delete mode 100644 website/src/server.html diff --git a/website/Caddyfile b/website/Caddyfile index 9ede5bf9d..1ae4639f5 100644 --- a/website/Caddyfile +++ b/website/Caddyfile @@ -27,9 +27,13 @@ header @assets Cache-Control "public, max-age=31536000, immutable" @media path /media/* /fonts/* /og.png /favicon* /apple-touch-icon.png header @media Cache-Control "public, max-age=604800" + # The server guide became a section of the documentation. + redir /server /docs/hosting permanent + redir /server.html /docs/hosting permanent rewrite /privacy /privacy.html - rewrite /server /server.html - @pages path / /index.html /404.html /privacy.html /server.html + @doc path_regexp doc ^/docs/([a-z-]+)$ + rewrite @doc /docs/{re.doc.1}.html + @pages path / /index.html /404.html /privacy.html /docs /docs/* /sitemap.xml header @pages Cache-Control "no-cache" @legal path /LEGAL.md /fonts/*.txt header @legal Content-Type "text/plain; charset=utf-8" diff --git a/website/Dockerfile b/website/Dockerfile index a5ae2f744..ea9cc9afc 100644 --- a/website/Dockerfile +++ b/website/Dockerfile @@ -4,6 +4,7 @@ FROM node:22-alpine AS build WORKDIR /site COPY build.mjs ./ COPY src ./src +COPY docs ./docs COPY public ./public COPY LEGAL.md ./ ARG GITHUB_TOKEN diff --git a/website/LEGAL.md b/website/LEGAL.md index 9700017dd..a68797346 100644 --- a/website/LEGAL.md +++ b/website/LEGAL.md @@ -64,10 +64,19 @@ shown as screenshots of the game, as the fan websites about the game, with the disclaimer they require. The site offers no game files: players need their own legally obtained copy of Minecraft: Java Edition. +### The launcher's Servers page + +| Files in `public/media/docs/` | Source | What it shows | +| --- | --- | --- | +| `servers-create.webp`, `servers-dashboard.webp`, `servers-invite.webp`, `servers-backups.webp` | Screenshots of the Horizon launcher's Servers page (a debug build on Linux, with made-up addresses, names and `@example.com` emails), converted to WebP | The Create a server dialog, a running server, a Tailscale invitation, the Backups tab | + +They show only Horizon's own interface (MIT) and a default player head. + ## Text The parity table is generated from Horizon's README, and the patch notes -come from Horizon's GitHub releases: Horizon's own text, MIT. +come from Horizon's GitHub releases: Horizon's own text, MIT. The documentation +(`docs/*.md` in this folder, served under `/docs`) is Horizon's own text, MIT. ## Contributors diff --git a/website/README.md b/website/README.md index cfea517c3..76d8ecaf0 100644 --- a/website/README.md +++ b/website/README.md @@ -2,7 +2,7 @@ Live at **https://playhorizon.dev**. -One static page in Horizon's design language (`docs/design-system.md`), with the tokens of +A landing page and a documentation section in Horizon's design language (`docs/design-system.md`), with the tokens of `crates/horizon-theme` (generated into `src/tokens.css` by `cargo run -p xtask -- tokens`): Geist and Geist Mono, cool neutrals in a light and a dark appearance (the system's, or the toggle's) and one violet accent, numbered index lists with one-pixel rules, and short, eased @@ -14,18 +14,20 @@ no runtime dependencies. ``` build.mjs renders dist/ (no dependencies) +docs/*.md the documentation, one Markdown file per page: "# Title", a lede paragraph, then sections +docs/nav.json the order of the pages and the groups of the left navigation serve.mjs a tiny static server for local checks src/index.html the page, with {{placeholders}} build.mjs fills src/404.html the not-found page src/privacy.html what the launcher can send when players allow it, retention, deletion (/privacy) -src/server.html host a server (/server): docs/hosting.md rendered into the page +src/docs.html the template of every documentation page (/docs/...), with its left navigation src/tokens.css the design tokens, generated from crates/horizon-theme (do not edit) src/style.css every style, on top of the tokens src/main.js download buttons, patch notes, links, contributors, nav and menu, tabs, lightbox, motion src/markdown.js a small Markdown renderer (escapes everything), shared by build and page src/releases.js the patch notes' markup, shared by build and page src/contributors.js the contributors' filtering and markup, shared by build and page -public/ fonts, screenshots, icons, og.png, robots.txt, sitemap.xml: copied as is +public/ fonts, screenshots, icons, og.png, robots.txt: copied as is (sitemap.xml is written by the build) scripts/assets.mjs rebuilds public/ from the repo (fonts to WOFF2, images to WebP) scripts/shots.mjs Playwright screenshots at every width, and og.png Dockerfile, Caddyfile, railway.json the Railway service @@ -36,7 +38,7 @@ shots/ (gitignored) full-page screenshots at 360–1920 px, a 1250× ## What comes from where - **Built in** (`build.mjs`): the parity table, its score, harness count and audit date, - all from `README.md`; the server guide (`/server`) from `docs/hosting.md`; the Discord and Sponsor links from + all from `README.md`; the documentation pages (`/docs`) from `website/docs/`; the Discord and Sponsor links from `launcher/links.json`; the latest releases and the contributors (`/repos/ludovic111/horizon/contributors`, bots left out, the owner first), when GitHub answers; without an answer the build still succeeds and the Contributors block and its menu entries stay hidden until the page loads them. Locally these come from @@ -48,6 +50,17 @@ shots/ (gitignored) full-page screenshots at 360–1920 px, a 1250× and `links.json` from `main`. Each falls back to what was built in, and the download button to the releases page. +## The documentation + +`docs/.md` becomes `/docs/` (`index.md` is `/docs/`). Write for players first, then hosters, +then contributors; plain words, short paragraphs; claim only what players can download today, and +mark merged-but-unreleased things "next release". `{{HARNESSES}}` and `{{PERCENT}}` are filled from +the README. A line holding only `![caption](/media/...)` becomes a figure (the file must be in +`public/media/`); links to other pages are `/docs/#heading`. The build checks every link +between pages and every image, and fails with the list when one is broken. `/server` +redirects to `/docs/hosting`. The developer docs in the repository's `docs/` stay as they are and are linked from +the Contributing page. + ## Run it locally ```sh diff --git a/website/build.mjs b/website/build.mjs index 99fafd73a..442ad9996 100644 --- a/website/build.mjs +++ b/website/build.mjs @@ -1,8 +1,9 @@ // Builds the site into dist/: src/index.html with the README's parity table and -// the community links and contributors baked in, plus public/ and fingerprinted CSS and JS. No dependencies. +// the community links and contributors baked in, the documentation (docs/*.md, one page each, listed in +// docs/nav.json), plus public/ and fingerprinted CSS and JS. No dependencies. // // Railway builds only website/, so the README and links.json come from the repo when they -// are next to it (a local checkout) and from main on GitHub otherwise. The latest releases and +// are next to it (a local checkout) and from main on GitHub otherwise. The documentation lives in website/. The latest releases and // the contributors are baked in when GitHub answers, so the page reads well before (or without) JavaScript. import { readFile, writeFile, mkdir, rm, cp } from "node:fs/promises"; import { existsSync } from "node:fs"; @@ -29,11 +30,6 @@ async function repoFile(path) { // The README: required, a site with a stale or missing parity table is worse than no deploy. const [readme, readmeFrom] = await repoFile("README.md"); -// The server guide (/server) is docs/hosting.md from its first section on: the page has its own title and lede. -const [hosting] = await repoFile("docs/hosting.md"); -const guideStart = hosting.search(/^## /m); -if (guideStart < 0) throw new Error("docs/hosting.md: no '## ' section"); - let links = { ...DEFAULT_LINKS }; try { const parsed = JSON.parse((await repoFile("launcher/links.json"))[0]); @@ -203,10 +199,81 @@ const values = { CONTRIBUTORS_HIDDEN: contributors.length ? "" : " hidden", BAKED: JSON.stringify(baked).replace(/.md: "# Title", a one-paragraph lede, then the body. docs/nav.json orders them in groups. + +const docsNav = JSON.parse(await readFile(join(site, "docs", "nav.json"), "utf8")); +const docs = []; +for (const { group, pages: slugs } of docsNav) { + for (const slug of slugs) { + const file = `${slug}.md`; + const text = (await readFile(join(site, "docs", file), "utf8")).replace(/\r\n?/g, "\n"); + const m = text.match(/^# (.+)\n\n((?:[^\n]+\n)+)\n/); + if (!m) throw new Error(`docs/${file}: needs "# Title", a blank line, a lede paragraph and a blank line`); + docs.push({ slug, file, group, title: m[1].trim(), lede: m[2].trim().replace(/\n/g, " "), body: text.slice(m[0].length), path: slug === "index" ? "/docs/" : `/docs/${slug}` }); + } +} +const plain = (md) => md.replace(/`/g, "").replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/\*\*/g, ""); +const anchors = new Map(); // path -> ids, to check every link between the pages +const problems = []; +const renderedDocs = docs.map((d) => { + const headings = []; + const html = markdown(d.body.replaceAll("{{HARNESSES}}", harnesses).replaceAll("{{PERCENT}}", percent), { site: true, headings }); + anchors.set(d.path, new Set(headings.map((h) => h.id))); + return { ...d, html, headings }; +}); +for (const d of renderedDocs) { + for (const [, link] of d.html.matchAll(/ + docsNav + .map(({ group, pages: slugs }) => { + const items = slugs + .map((slug) => { + const d = docs.find((x) => x.slug === slug); + return `
  • ${escape(d.title)}
  • `; + }) + .join(""); + return `

    ${escape(group)}

    \n
      ${items}
    `; + }) + .join("\n"); +const pagerLink = (d, rel) => (d ? `${rel === "next" ? "Next" : "Previous"}${escape(d.title)}` : ""); + +await mkdir(join(dist, "docs"), { recursive: true }); +const docPageFiles = []; +const docPages = renderedDocs.map((d, i) => { + const toc = d.headings.filter((h) => h.level === 2); + return { + file: join("docs", d.slug + ".html"), + values: { + DOC_TITLE: escape(d.title), + DOC_DESC: escape(plain(d.lede).slice(0, 220)), + DOC_PATH: d.path, + DOC_GROUP: escape(d.group), + DOC_LEDE: inline(d.lede, true), + DOC_NAV: docNav(d), + DOC_TOC: toc.length >= 4 ? ` ` : "", + DOC_BODY: d.html, + DOC_PAGER: pagerLink(renderedDocs[i - 1], "prev") + pagerLink(renderedDocs[i + 1], "next"), + DOC_FILE: d.file, + }, + }; +}); + +const pages = ["index.html", "404.html", "privacy.html"]; for (const page of pages) { let html = await readFile(join(site, "src", page), "utf8"); html = html.replace(/\{\{(\w+)\}\}/g, (all, key) => { @@ -216,15 +283,32 @@ for (const page of pages) { html = html.replace(/href="\/(favicon\.svg|favicon-32\.png|apple-touch-icon\.png)"/g, (all, icon) => `href="/${icon}?v=${iconVersions[icon]}"`); await writeFile(join(dist, page), html); } +const docTemplate = await readFile(join(site, "src", "docs.html"), "utf8"); +for (const { file, values: own } of docPages) { + let html = docTemplate.replace(/\{\{(\w+)\}\}/g, (all, key) => { + const value = key in own ? own[key] : values[key]; + if (value === undefined) throw new Error(`docs.html: unknown placeholder ${all}`); + return value; + }); + html = html.replace(/href="\/(favicon\.svg|favicon-32\.png|apple-touch-icon\.png)"/g, (all, icon) => `href="/${icon}?v=${iconVersions[icon]}"`); + await writeFile(join(dist, file), html); + docPageFiles.push(file); +} // The pages' inline scripts (they mark the page as scripted and apply the saved theme before CSS // applies) and the inlined stylesheet: the Content-Security-Policy in the Caddyfile allows them by hash. -const allHtml = (await Promise.all(pages.map((page) => readFile(join(dist, page), "utf8")))).join("\n"); +const allHtml = (await Promise.all([...pages, ...docPageFiles].map((page) => readFile(join(dist, page), "utf8")))).join("\n"); const hashes = (re) => [...new Set([...allHtml.matchAll(re)].map((m) => `'sha256-${createHash("sha256").update(m[1]).digest("base64")}'`))].join(" "); await writeFile(join(dist, ".csp-script"), hashes(/ + + + +
    +
    + Horizon + Docs + + GitHub + Download + +
    +
    + +
    +
    + Docs menu + +
    + + +
    +

    {{DOC_GROUP}}

    +

    {{DOC_TITLE}}

    +

    {{DOC_LEDE}}

    +{{DOC_TOC}} +
    +{{DOC_BODY}} +
    + +

    Edit this page on GitHub · Spotted something wrong? Open an issue or ask on Discord.

    +

    Not an official Minecraft product. Not approved by or associated with Mojang or Microsoft.

    +
    +
    + + + diff --git a/website/src/index.html b/website/src/index.html index eac74b409..7668951a7 100644 --- a/website/src/index.html +++ b/website/src/index.html @@ -45,7 +45,7 @@ Notes Community Contributors - Server + Docs diff --git a/website/src/markdown.js b/website/src/markdown.js index a17ab4b96..252e554ec 100644 --- a/website/src/markdown.js +++ b/website/src/markdown.js @@ -9,15 +9,17 @@ export function escape(text) { return text.replace(/[&<>"']/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[c]); } -function href(url) { +function href(url, site) { url = url.trim(); if (/^(https?:|mailto:)/i.test(url)) return url; - if (url.startsWith("#")) return null; // README anchors have no target here + // The docs pages (`site`) link each other and their own headings; the README's anchors have no target here. + if (site && (/^\/(?!\/)/.test(url) || url.startsWith("#"))) return url; + if (url.startsWith("#")) return null; if (/^[a-z]+:/i.test(url)) return null; // javascript: and the like return REPO_BLOB + url.replace(/^\.?\//, ""); } -export function inline(text) { +export function inline(text, site = false) { const codes = []; let out = text.replace(/`([^`]+)`/g, (_, code) => { codes.push(code); @@ -35,8 +37,8 @@ export function inline(text) { .replace(/<(https?:\/\/[^\s&]+)>/g, (_, u) => `${u}`); out = out.replace(/\u0001(\d+)\u0001/g, (_, i) => { const [label, url] = links[i]; - const target = href(url); - const body = inline(label); + const target = href(url, site); + const body = inline(label, site); return target ? `${body}` : body; }); return out.replace(/\u0000(\d+)\u0000/g, (_, i) => `${escape(codes[i])}`); @@ -45,7 +47,7 @@ export function inline(text) { const indentOf = (line) => line.match(/^ */)[0].length; const ITEM = /^(\s*)([-*+]|\d+[.)])\s+(.*)$/; -function list(lines, start) { +function list(lines, start, site) { // Collects the items at this list's indentation; deeper lines belong to the item above. const base = indentOf(lines[start]); const ordered = /\d/.test(lines[start].match(ITEM)[2]); @@ -65,7 +67,7 @@ function list(lines, start) { if (m && indentOf(line) === base) { items.push({ text: [m[3]], children: [] }); } else if (m && indentOf(line) > base) { - const [html, end] = list(lines, i); + const [html, end] = list(lines, i, site); items[items.length - 1].children.push(html); i = end; continue; @@ -77,12 +79,24 @@ function list(lines, start) { i++; } const tag = ordered ? "ol" : "ul"; - const body = items.map((it) => `
  • ${inline(it.text.join(" "))}${it.children.join("")}
  • `).join(""); + const body = items.map((it) => `
  • ${inline(it.text.join(" "), site)}${it.children.join("")}
  • `).join(""); return [`<${tag}>${body}`, i]; } -/** Renders Markdown; `shift` moves headings down (a `#` becomes `h{1 + shift}`). */ -export function markdown(source, { shift = 0 } = {}) { +const slug = (text) => + text + .toLowerCase() + .replace(/`/g, "") + .replace(/[^a-z0-9]+/g, "-") + .replace(/^-|-$/g, ""); + +/** + * Renders Markdown; `shift` moves headings down (a `#` becomes `h{1 + shift}`). + * `site` is for the docs pages: links to the site's own pages and anchors stay as they are, `##` and `###` + * headings get an id (and are pushed onto `headings`, for a table of contents), and a line holding only + * `![caption](/media/…)` becomes a figure. + */ +export function markdown(source, { shift = 0, site = false, headings = null } = {}) { const lines = source.replace(/\r\n?/g, "\n").split("\n"); const out = []; let i = 0; @@ -95,7 +109,17 @@ export function markdown(source, { shift = 0 } = {}) { let m; if ((m = line.match(/^(#{1,6})\s+(.*?)\s*#*$/))) { const level = Math.min(6, m[1].length + shift); - out.push(`${inline(m[2])}`); + let id = ""; + if (site && (m[1].length === 2 || m[1].length === 3)) { + const base = slug(m[2]); + id = base; + for (let n = 2; headings && headings.some((h) => h.id === id); n++) id = `${base}-${n}`; + headings?.push({ level: m[1].length, text: m[2].replace(/`/g, ""), id }); + } + out.push(`${inline(m[2], site)}`); + i++; + } else if (site && (m = line.match(/^!\[([^\]]*)\]\((\/media\/[\w./-]+)\)\s*$/))) { + out.push(`
    ${escape(m[1])}
    ${inline(m[1], true)}
    `); i++; } else if ((m = line.match(/^\s*(```|~~~)/))) { const fence = m[1]; @@ -108,13 +132,13 @@ export function markdown(source, { shift = 0 } = {}) { out.push("
    "); i++; } else if (ITEM.test(line)) { - const [html, end] = list(lines, i); + const [html, end] = list(lines, i, site); out.push(html); i = end; } else if (line.startsWith(">")) { const quote = []; while (i < lines.length && lines[i].startsWith(">")) quote.push(lines[i++].replace(/^>\s?/, "")); - out.push(`
    ${markdown(quote.join("\n"), { shift })}
    `); + out.push(`
    ${markdown(quote.join("\n"), { shift, site })}
    `); } else { const para = []; while ( @@ -125,7 +149,7 @@ export function markdown(source, { shift = 0 } = {}) { ) { para.push(lines[i++].trim()); } - out.push(`

    ${inline(para.join(" "))}

    `); + out.push(`

    ${inline(para.join(" "), site)}

    `); } } return out.join("\n"); diff --git a/website/src/server.html b/website/src/server.html deleted file mode 100644 index 94f470678..000000000 --- a/website/src/server.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - Host a server · Horizon - - - - - - - - - - -
    -
    -

    ServerEarly version

    -

    Host a server.

    -

    horizon-server runs a Minecraft Java Edition 26.3 server with Horizon's own game as the engine: one native program, no Java, one settings file, a command line, a web panel and backups. Vanilla and Horizon clients can join. This page is docs/hosting.md, built into the site.

    -
    -{{SERVER_GUIDE}} -
    - -

    Not an official Minecraft product. Not approved by or associated with Mojang or Microsoft.

    -
    -
    - - - diff --git a/website/src/style.css b/website/src/style.css index 8be518881..03004464b 100644 --- a/website/src/style.css +++ b/website/src/style.css @@ -431,3 +431,71 @@ figcaption span { font-family: var(--mono); font-size: var(--text-micro); letter .privacy h1 { margin-bottom: 16px; } .privacy .prose { margin: 40px 0; } .privacy .disclaimer { margin-top: 32px; } + +/* --- Documentation (/docs): a left navigation and one page at a time --------------------- */ + +.docs-bar { + position: sticky; top: 0; z-index: 20; height: 56px; + background: color-mix(in srgb, var(--page) 88%, transparent); + -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2); + box-shadow: 0 1px 0 var(--rule); +} +.docs-bar-inner { display: flex; align-items: center; gap: 16px; height: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--g); } +.docs-bar-title { padding-left: 16px; border-left: 1px solid var(--rule); color: var(--muted); font-size: var(--text-label); } +.docs-bar-end { margin-left: auto; display: flex; align-items: center; gap: 16px; } +.docs-bar-link { color: var(--muted); font-size: var(--text-label); } +.docs-bar-link:hover { color: var(--ink); } +.docs { + display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); + max-width: var(--max); margin: 0 auto; padding: 48px var(--g) 0; align-items: start; +} +.docs-nav-wrap { position: sticky; top: 80px; max-height: calc(100vh - 104px); overflow-y: auto; padding-bottom: 24px; } +.docs-nav-wrap summary { display: none; } +.docs-nav-group { margin: 28px 0 8px; font: var(--text-micro) / var(--text-micro-line) var(--mono); letter-spacing: var(--text-micro-tracking); text-transform: uppercase; color: var(--muted); } +.docs-nav-group:first-child { margin-top: 0; } +.docs-nav li a { display: block; padding: 6px 12px; margin-left: -12px; border-radius: var(--radius); color: var(--ink-soft); font-size: var(--text-ui); } +.docs-nav li a:hover { background: var(--plate-soft); color: var(--ink); } +.docs-nav li a[aria-current] { background: var(--plate-soft); color: var(--ink); font-weight: 500; } +.docs-main { min-width: 0; padding-bottom: 48px; } +.docs-main .title { margin-bottom: 16px; } +.docs-main .lede { max-width: 64ch; font-size: var(--text-heading); line-height: 1.45; } +.docs-toc { margin-top: 28px; max-width: 72ch; } +.docs-toc p { font: var(--text-micro) / var(--text-micro-line) var(--mono); letter-spacing: var(--text-micro-tracking); text-transform: uppercase; color: var(--muted); margin-bottom: 8px; } +.docs-toc ul { display: flex; flex-wrap: wrap; gap: 6px; } +.docs-toc a { display: block; padding: 4px 12px; border-radius: var(--radius-pill); background: var(--plate-soft); color: var(--ink-soft); font-size: var(--text-label); } +.docs-toc a:hover { background: var(--plate); color: var(--ink); } +.docs-prose { max-width: 72ch; margin-top: 40px; font-size: var(--text-body); } +.docs-prose > * + * { margin-top: 14px; } +.docs-prose h2 { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--rule); font-size: clamp(24px, 2.4vw, 30px); line-height: 1.2; letter-spacing: var(--text-title-tracking); scroll-margin-top: 80px; } +.docs-prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; } +.docs-prose h3 { margin-top: 32px; scroll-margin-top: 80px; } +.docs-prose ol { list-style: decimal; } +.docs-prose pre { font: 0.86em/1.6 var(--mono); } +.docs-prose blockquote { padding: 2px 0 2px 16px; border-left: 2px solid var(--accent); color: var(--ink-soft); } +.docs-prose blockquote > * + * { margin-top: 8px; } +.docs-prose figure { margin: 28px 0; } +.docs-prose figure img { width: 100%; border-radius: var(--radius-plate); box-shadow: 0 0 0 1px var(--rule); } +.docs-prose figcaption { margin-top: 10px; font-size: var(--text-caption); color: var(--muted); } +.docs-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 72ch; margin-top: 56px; } +.docs-pager a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius-plate); box-shadow: 0 0 0 1px var(--rule); color: var(--ink); font-weight: 500; } +.docs-pager a:hover { background: var(--plate-soft); color: var(--ink); } +.docs-pager a span { font: var(--text-micro) / var(--text-micro-line) var(--mono); letter-spacing: var(--text-micro-tracking); text-transform: uppercase; color: var(--muted); font-weight: 400; } +.docs-pager-next { grid-column: 2; text-align: right; } +.docs-edit { margin-top: 32px; font-size: var(--text-caption); color: var(--muted); } +.docs-edit a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; } +.docs-main .disclaimer { margin-top: 24px; } + +@media (max-width: 900px) { + .docs { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 12px; } + .docs-nav-wrap { position: static; max-height: none; overflow: visible; margin-bottom: 24px; border-bottom: 1px solid var(--rule); } + .docs-nav-wrap summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 500; list-style: none; } + .docs-nav-wrap summary::-webkit-details-marker { display: none; } + .docs-nav-wrap summary::after { content: "+"; margin-left: auto; color: var(--muted); } + .docs-nav-wrap[open] summary::after { content: "\2212"; } + .docs-pager { grid-template-columns: minmax(0, 1fr); } + .docs-pager-next { grid-column: 1; } + .docs-bar-link { display: none; } +} +@media (pointer: coarse) { + .docs-nav li a, .docs-toc a, .docs-bar-title, .docs-bar-link { display: flex; align-items: center; min-height: 44px; } +}