summaryrefslogtreecommitdiff
path: root/docs/typ/style.typ
diff options
context:
space:
mode:
Diffstat (limited to 'docs/typ/style.typ')
-rw-r--r--docs/typ/style.typ31
1 files changed, 25 insertions, 6 deletions
diff --git a/docs/typ/style.typ b/docs/typ/style.typ
index c7e91495..23bdab3c 100644
--- a/docs/typ/style.typ
+++ b/docs/typ/style.typ
@@ -308,6 +308,7 @@
(name: "git.0x4200.cafe", web: "https://git.0x4200.cafe/pardes", clone: "https://git.0x4200.cafe/pardes.git"),
),
license: "ISC",
+ changes: "https://git.sr.ht/~gbrls/pardes/tree/main/item/src/CHANGELOG.md",
// built binaries to download: the version they are, where the
// checksums are, and a file per program (install.typ shows them)
download: (
@@ -315,10 +316,10 @@
sums: "https://pub-66384ba880784f119ce95123b92fa5c6.r2.dev/SHA256SUMS",
files: (
(program: "pardes", what: "the terminal build, static, any x86_64 Linux",
- url: "https://pub-66384ba880784f119ce95123b92fa5c6.r2.dev/pardes-x86_64-linux-static",
+ url: "https://pub-66384ba880784f119ce95123b92fa5c6.r2.dev/pardes-x86_64-linux-static", bytes: 62034424,
sha256: "9db75765a8ad2fc881164b98ff69f0d34ded582304428c28aee7f87ccb211061"),
(program: "pardes-gui", what: "the window, x86_64 Linux with glibc 2.29 or later; it loads Wayland or X11 and GL or Vulkan from the system",
- url: "https://pub-66384ba880784f119ce95123b92fa5c6.r2.dev/pardes-gui-x86_64-linux",
+ url: "https://pub-66384ba880784f119ce95123b92fa5c6.r2.dev/pardes-gui-x86_64-linux", bytes: 66620552,
sha256: "d788213d14e69ee32348cee9b707b046c71c208c6436d84988e76aaf117095da"),
),
),
@@ -534,17 +535,18 @@
/// the repository root (the site serves it from the same path under
/// docs/site/); `size` is its pixel (width, height); each pin is (label,
/// x, y) in pixels of that image.
-#let annotated(src, size, ..pins) = {
+#let annotated(src, size, alt: "", ..pins) = {
let (w, h) = size
let pins = pins.pos()
context if html-out() {
let web = src.trim("/docs/site/", at: start)
html.elem("figure", attrs: (class: "annotated"), {
html.elem("div", attrs: (class: "frame"), {
- html.elem("img", attrs: (src: web, alt: "", width: str(w), height: str(h)))
+ html.elem("img", attrs: (src: web, alt: alt, width: str(w), height: str(h)))
for (i, (label, x, y)) in pins.enumerate() {
html.elem("span", attrs: (class: "pin", "aria-hidden": "true",
- style: "left:" + str(calc.round(100 * x / w, digits: 2)) + "%;top:" + str(calc.round(100 * y / h, digits: 2)) + "%"), str(i + 1))
+ // repr, not str: str writes a negative with U+2212, which CSS rejects
+ style: "left:" + repr(calc.round(100 * x / w, digits: 2)) + "%;top:" + repr(calc.round(100 * y / h, digits: 2)) + "%"), str(i + 1))
}
})
html.elem("ol", attrs: (class: "pins"), for (label, x, y) in pins { html.elem("li", label) })
@@ -556,7 +558,7 @@
align(center + horizon, text(size: 0.75em, weight: "bold", fill: white, str(n))))
block(breakable: false, grid(columns: (width, 1fr), column-gutter: 1.2em, align: horizon,
box(width: width, height: h * k, {
- place(top + left, image(src, width: width))
+ place(top + left, image(src, width: width, alt: alt))
for (i, (label, x, y)) in pins.enumerate() {
place(top + left, dx: x * k - 0.625em, dy: y * k - 0.625em, pin(i + 1))
}
@@ -565,3 +567,20 @@
))
}
}
+
+/// A pane's box as it looks: blank in normal mode, `^` in insert, `$` raw
+/// (a terminal's own input); `unsaved: true` fills it, as an unsaved
+/// file's is. In HTML a span the stylesheet draws, its mode said in words.
+#let mode-box(mark, unsaved: false) = {
+ let mode = if mark == "^" { "insert" } else if mark == "$" { "raw" } else { "normal" }
+ context if html-out() {
+ html.elem("span", attrs: (class: "mode-box" + if unsaved { " unsaved" } else { "" },
+ role: "img", "aria-label": mode + " mode box" + if unsaved { ", unsaved" } else { "" }), mark)
+ } else {
+ box(width: 1.05em, height: 1.05em, baseline: 0.15em, radius: 1pt,
+ fill: if unsaved { palette.col-grip } else { palette.tag-bg },
+ stroke: 0.7pt + palette.grip,
+ align(center + horizon, text(font: mono, size: 0.8em, weight: "bold",
+ fill: if unsaved { white } else { palette.ink }, mark)))
+ }
+}