summaryrefslogtreecommitdiff
path: root/docs/site/site.typ
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-01 14:03:11 -0300
committerGabriel Schneider <[email protected]>2026-10-01 15:24:04 -0300
commit3b186b7724dd3ca0ff67c3c8a0f9823f0f161fc5 (patch)
treec331f529df447bbeee56cfa21e7f7d3438bcf62b /docs/site/site.typ
parent54948bf22fb891bd31fcd5dc33e0bce7552fe1d4 (diff)
downloadpardes-3b186b7724dd3ca0ff67c3c8a0f9823f0f161fc5.tar.gz
pardes-3b186b7724dd3ca0ff67c3c8a0f9823f0f161fc5.zip
The landing's words jump to their recordings, the casts open on their telling frame, and #mode-box draws the box
Each recording on the landing has an anchor (rec-<name>); the "What's in it" words jump to theirs (Terminals, PDFs, Images, Diff review, Scripting) and the recording's caption ends in a link to the docs; Language servers and Themes, with no recording, link to the docs. A cast's `poster_at` in casts.toml picks the frame it shows until it plays: live-text at the error, terminals at the copied line, petscii on the Mandelbrot; the casts wait for the in-view script to play them. A caption may hold markup: the 9P clip links 9ns to setup. The downloads give their size, read from project.download, and the footer links the changes (project.changes). The guide's annotated pane has alt text, pin 1 beside the workspace tag rather than on Changelog, and pin 5 on the body's text; pin positions are written with repr, since str puts a U+2212 minus CSS cannot read. #mode-box(mark, unsaved:) draws a pane's box as it looks, in print and HTML. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'docs/site/site.typ')
-rw-r--r--docs/site/site.typ44
1 files changed, 30 insertions, 14 deletions
diff --git a/docs/site/site.typ b/docs/site/site.typ
index 787844f5..62b1292e 100644
--- a/docs/site/site.typ
+++ b/docs/site/site.typ
@@ -27,14 +27,16 @@
the interface, and the 9P protocol.],
status: [Linux; macOS in progress. Version #version.],
// what's in it: a word each, linked to where it is told; no prose
+ // what's in it: each word jumps to its recording on this page when it
+ // has one, and that recording's caption links on to the docs
inside: (
- ("Terminals", "guide.html#terminals"),
- ("PDFs", "builtins.html#builtin-PdfSections"),
- ("Images", "reference.html#panes"),
- ("Language servers", "setup.html#language-servers"),
- ("Diff review", "guide.html#reviewing-diffs"),
- ("Scripting", "scripting.html"),
- ("Themes", "themes.html"),
+ (name: "Terminals", rec: "terminals", docs: "guide.html#terminals"),
+ (name: "PDFs", rec: "pdf-navigation", docs: "builtins.html#builtin-PdfSections"),
+ (name: "Images", rec: "image-pane", docs: "reference.html#panes"),
+ (name: "Language servers", rec: none, docs: "setup.html#language-servers"),
+ (name: "Diff review", rec: "diff-review", docs: "guide.html#reviewing-diffs"),
+ (name: "Scripting", rec: "scripting-over-9p", docs: "scripting.html"),
+ (name: "Themes", rec: none, docs: "themes.html"),
),
terminal: [In a terminal],
window: [In its own window],
@@ -113,6 +115,7 @@
#el("footer", (class: "colophon"))[
pardes #version ·
source: #project.mirrors.map(m => el("a", (href: m.web))[#m.name]).join(", ") ·
+ #el("a", (href: project.changes))[changes] ·
#if project.license != none [#project.license license · ]
built from `docs/typ` with Typst ·
#el("a", (href: "fonts/LICENSE-DepartureMono.txt"))[fonts] (OFL) ·
@@ -147,25 +150,35 @@
]
#let placeholder = el("img", (src: "media/placeholder.svg", alt: "", width: "640", height: "400"))[]
+/// A recording's caption: its text (which may hold #link markup), then the
+/// docs of the "What's in it" word that jumps here, if any.
+#let caption(c) = {
+ if c.caption.contains("#") { eval(c.caption, mode: "markup") } else { c.caption }
+ let to = landing.inside.find(i => i.rec == c.name)
+ if to != none [ #el("a", (class: "more", href: to.docs))[#to.name in the docs →]]
+}
+
/// A terminal recording: a box the player fills, its data inline (so it
/// plays from file://), its caption under it.
#let ready-casts = casts.filter(c => c.ready)
-#let cast(c, i) = el("figure", (class: if i == 0 { "clip cast first" } else { "clip cast" }))[
+#let cast(c, i) = el("figure", (class: if i == 0 { "clip cast first" } else { "clip cast" }, id: "rec-" + c.name))[
#if c.ready { el("div", (class: "player", id: "cast-" + c.name, "aria-label": c.title))[] } else { placeholder }
- #el("figcaption")[#el("strong")[#c.title.] #c.caption]
+ #el("figcaption")[#el("strong")[#c.title.] #caption(c)]
]
#let player-script = {
let list = ready-casts.enumerate().map(((i, c)) => (
id: "cast-" + c.name, data: read("casts/" + c.name + ".cast"),
- cols: c.cols, rows: c.rows,
+ cols: c.cols, rows: c.rows, poster: "npt:0:" + str(c.at("poster_at", default: 2)),
))
// "</" may not appear inside a script element
let data = json.encode(list, pretty: false).replace("</", "<\\/")
el("script", (src: "player/asciinema-player.min.js"))[]
- el("script")[#("for (const c of " + data + ") { const el = document.getElementById(c.id); el.player = AsciinemaPlayer.create({data: c.data}, el, {cols: c.cols, rows: c.rows, autoPlay: true, loop: true, fit: 'width', poster: 'npt:0:2'}); }")]
+ el("script")[#("for (const c of " + data + ") { const el = document.getElementById(c.id); el.player = AsciinemaPlayer.create({data: c.data}, el, {cols: c.cols, rows: c.rows, autoPlay: false, loop: true, fit: 'width', poster: c.poster}); }")]
}
/// Plays a recording while it is on screen and pauses it once it leaves.
+/// The casts wait for it (autoPlay off) so each shows its poster frame
+/// until then; the videos autoplay by themselves too.
#let in-view-script = el("script")[#(
"(() => { if (!('IntersectionObserver' in window)) return;
" +
@@ -184,7 +197,10 @@
#el("h1", (class: "masthead"))[pardes]
#el("p", (class: "lead"))[#landing.lead]
#el("ul", (class: "inside", "aria-label": "What's in it"))[
- #for (name, to) in landing.inside { el("li")[#el("a", (href: to))[#name]] }
+ #for i in landing.inside {
+ let to = if i.rec != none { "#rec-" + i.rec } else { i.docs }
+ el("li")[#el("a", (href: to, title: if i.rec != none { "watch it here; the docs: " + i.docs } else { "the docs" }))[#i.name]]
+ }
]
#el("p", (class: "credit"))[#landing.credit]
#el("p", (class: "runs"))[#landing.status]
@@ -203,9 +219,9 @@
#el("h2", (class: "shelf"))[#landing.window]
#el("div", (class: "clips"))[
#for c in clips.filter(c => c.at("landing", default: true)) {
- el("figure", (class: "clip"))[
+ el("figure", (class: "clip", id: "rec-" + c.name))[
#if c.ready { video(c) } else { placeholder }
- #el("figcaption")[#c.caption]
+ #el("figcaption")[#caption(c)]
]
}
]