Repository navigation
Closed
Description
Motivation
The Fetcher × Renderer × Options design produces a combinatorial surface that's hard to grok from AGENTS.md prose alone. Users can't currently browse what clock + ratio = \"year\" + gauge actually looks like without writing a config and running it. The dogfood .splashboard/config.toml covers a handful of combos as a visual smoke test, but it's not browsable, not searchable, and grows unwieldy as widgets multiply.
Goal: a published docs site that's
- Browsable — one page per fetcher, showing every supported (shape, renderer, option-preset) combination with a rendered example next to the config snippet.
- Accurate by construction — the
fetcher × shapeandshape × renderermatrices are generated from code, not hand-maintained. Snapshots are re-rendered from the actual runtime, not drawn by hand. - Readable — color-preserving snapshots (not plain ASCII), so badges, gauges, heatmaps look right.
- Public — GitHub Pages, linked from the README.
Pipeline
handwritten MDX (docs-site/src/content/widgets/<fetcher>.mdx) ┐
generated matrices MD (from Registry metadata) ├→ Astro + Starlight → static HTML → GH Pages
generated snapshots (HTML span-per-cell) ┘
Components
xtask crate (workspace-level)
cargo xtask gen-matrix— reads the built-inRegistry, emitsdocs-site/src/content/reference/matrix.mdwith:- Fetcher × Shape table (each fetcher's
shapes()) - Shape × Renderer table (each renderer's
accepts()) - Safety-class column per fetcher
- Fetcher × Shape table (each fetcher's
cargo xtask snapshot— for each registered(fetcher, renderer, option-preset)tuple, renders the widget via ratatuiTestBackendinto aBuffer, then converts to an HTML fragment:<pre class=\"splash-snapshot\">containing one<span style=\"color:#…;background:#…\">per contiguous same-style cell run. Writes todocs-site/src/content/widgets/<fetcher>/<preset>.html.- Presets declared in
xtask/src/presets.rs(Rust-typed) so adding a showcase is a code PR, not config sprinkled across the docs tree.
- Presets declared in
cargo xtask docs— convenience target: runs both generators thenastro build.
docs-site/ (Astro + Starlight)
docs-site/at repo root, Node-based.- Starlight theme (sidebar per fetcher / renderer / reference, built-in search).
- Handwritten
docs-site/src/content/widgets/<fetcher>.mdxwith prose on options, then<Snapshot id=\"…\" />MDX components that inline the generated HTML fragments. - GitHub Actions builds and publishes to
gh-pageson every merge tomain.
Snapshot format
- Self-contained HTML fragments:
<pre class=\"splash-snapshot\">…<span style=\"…\">X</span>…</pre>. - Color mapping: ratatui
Color→ hex via a small table (ANSI 16 baseline; truecolor passes through). - Style runs: collapse adjacent same-style cells into one
<span>to keep the DOM tiny. - Plain-text fallback (ANSI stripped) written alongside for GitHub-MD viewing contexts.
Open decisions (document + revisit in PR)
- Presets in Rust (
xtask) vs TOML (docs-site/presets.toml). Rust keeps it typed; TOML keeps it writable by non-Rust contributors. <Snapshot />implementation: MDX integration that reads files at build, or plain raw-HTML include?- Dark / light theme: CSS invert at runtime, or two snapshots per preset?
- Link from README as soon as first page ships, or wait for GA?
Out of scope
- SVG / PNG rendering. HTML spans cover color and selectability; SVG adds font-metrics complexity for no win on monospace widgets.
- Self-hosting beyond GH Pages.
- Runtime-embedded docs (a
splashboard help <fetcher>CLI). Revisit if users ask. - Screensaver / persistent animation previews — the existing 2 s animation window is enough for the site to capture motion via the animation frames it already renders.
Done looks like
-
cargo xtask docsfrom a clean clone produces a full site atdocs-site/dist/. - Every fetcher in the
Registryhas a page with ≥1 snapshot. - Matrices regenerate from code — adding a new fetcher / renderer and re-running
cargo xtask gen-matrixupdates the tables without a human editing markdown. - Site published at
https://unhappychoice.github.io/splashboard/. - README links to the site.
Related
- AGENTS.md
Shape × Fetcher × Renderersection — this site is its visual companion. - meta: widget catalog & roadmap #41 roadmap — matrix generation naturally surfaces which combinations are still stubs.
- Does not block meta: widget catalog & roadmap #41 items; can ship independently.
Metadata
Metadata
Assignees
Labels
No labels
Activity
Merge pull request #54 from unhappychoice/feat/docs-site-52