diff options
Diffstat (limited to 'docs/typ/style.typ')
| -rw-r--r-- | docs/typ/style.typ | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/docs/typ/style.typ b/docs/typ/style.typ index f651878f..77c58fed 100644 --- a/docs/typ/style.typ +++ b/docs/typ/style.typ @@ -592,12 +592,14 @@ /// A recording from docs/site/media/clips.toml, by name. On the site the /// same video as the landing's (poster, autoplay muted loop, played while /// in view) and its caption; in print its poster, small, and the caption. -#let clip(name) = { +/// `wide: true` lets it take the page's full width (a recording of many +/// narrow columns). +#let clip(name, wide: false) = { let c = toml("../site/media/clips.toml").clip.find(c => c.name == name) assert(c != none, message: "no clip named " + name + " in clips.toml") let said = if c.caption.contains("#") { eval(c.caption, mode: "markup") } else { c.caption } context if html-out() { - html.elem("figure", attrs: (class: "clip inline", id: "rec-" + c.name), { + html.elem("figure", attrs: (class: "clip inline" + if wide { " wide" } else { "" }, id: "rec-" + c.name), { html.elem("video", attrs: (poster: "media/" + c.name + ".png", autoplay: "", muted: "", loop: "", playsinline: "", controls: ""), { html.elem("source", attrs: (src: "media/" + c.name + ".webm", type: "video/webm")) @@ -606,7 +608,7 @@ html.elem("figcaption", said) }) } else { - figure(image("/docs/site/media/" + c.name + ".png", width: 7cm, alt: c.caption), + figure(image("/docs/site/media/" + c.name + ".png", width: if wide { 11cm } else { 7cm }, alt: c.caption), caption: text(size: 0.9em, said), numbering: none, kind: "clip", supplement: none) } } |
