2024-01-02 05:03:29 +01:00
|
|
|
// would also be interesting to try out IBM Plex Mono/Sans sometime
|
|
|
|
#let atk = "Atkinson Hyperlegible"
|
|
|
|
#let fonts = (
|
|
|
|
main: (font: atk, size: 12pt),
|
|
|
|
|
|
|
|
title: (font: atk, size: 20pt),
|
|
|
|
subtitle: (font: atk, size: 10pt),
|
|
|
|
heading: (font: "Montserrat", weight: "regular"),
|
|
|
|
)
|
|
|
|
|
2024-01-10 21:22:29 +01:00
|
|
|
#let expand(it) = {
|
|
|
|
("("
|
|
|
|
+ upper(it.first())
|
|
|
|
+ "|"
|
|
|
|
+ it.first()
|
|
|
|
+ ")"
|
|
|
|
+ it.clusters().slice(1).join()
|
|
|
|
+ "s?")
|
|
|
|
}
|
|
|
|
#let singlify(it) = {
|
|
|
|
it = lower(it)
|
|
|
|
if it.ends-with("s") {
|
|
|
|
it = it.slice(0, -1)
|
|
|
|
}
|
|
|
|
it
|
|
|
|
}
|
|
|
|
#let terminate-recursion(it) = {
|
|
|
|
let clusters = it.text.clusters()
|
|
|
|
clusters.insert(1, "\u{FEFF}")
|
|
|
|
clusters.join()
|
|
|
|
}
|
|
|
|
// even though it looks like this could be automated with a `query`,
|
|
|
|
// this'd require wrapping the whole document in a show rule
|
|
|
|
// at which point `query` doesn't find anything anymore
|
|
|
|
#let terms = (
|
|
|
|
"source",
|
|
|
|
"AST",
|
|
|
|
"graph IR",
|
|
|
|
"runtime",
|
|
|
|
|
|
|
|
"optimizer",
|
|
|
|
"scheduler",
|
|
|
|
"VM",
|
|
|
|
|
|
|
|
"command",
|
|
|
|
"pipeline",
|
|
|
|
"input", "argument", "consumer",
|
|
|
|
"output", "streamer",
|
|
|
|
"modifier",
|
|
|
|
)
|
|
|
|
// yes, the shadowing is intentional
|
|
|
|
#let terms = regex(terms.map(expand).join("|"))
|
|
|
|
|
2024-01-01 23:34:34 +01:00
|
|
|
#let conf(
|
2024-01-02 05:03:29 +01:00
|
|
|
title: none,
|
|
|
|
subtitle: none,
|
|
|
|
doc,
|
2024-01-01 23:34:34 +01:00
|
|
|
) = {
|
2024-01-02 05:03:29 +01:00
|
|
|
set page(
|
|
|
|
numbering: "1 / 1",
|
2024-01-09 10:21:57 +01:00
|
|
|
margin: 3.25cm,
|
2024-01-02 05:03:29 +01:00
|
|
|
header: locate(loc => {
|
|
|
|
datetime.today().display()
|
|
|
|
|
|
|
|
if counter(page).at(loc).first() > 1 {
|
|
|
|
// on all pages other than the first, the title is useful to have at hand
|
|
|
|
h(1fr)
|
|
|
|
title
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
)
|
|
|
|
set text(..fonts.main)
|
|
|
|
set heading(numbering: "A.1")
|
|
|
|
|
2024-01-10 21:10:05 +01:00
|
|
|
show link: text.with(fill: blue)
|
2024-01-02 05:03:29 +01:00
|
|
|
show heading: it => text(..fonts.heading, it)
|
2024-01-09 10:21:57 +01:00
|
|
|
show raw.where(block: true): box.with(
|
|
|
|
fill: luma(95%),
|
|
|
|
inset: 1.25em,
|
|
|
|
radius: 0.75em,
|
|
|
|
width: 45em,
|
|
|
|
)
|
|
|
|
show raw.where(block: false): box.with(
|
|
|
|
fill: luma(95%),
|
2024-01-09 11:58:42 +01:00
|
|
|
outset: (y: 0.25em),
|
|
|
|
inset: (x: 0.15em),
|
2024-01-09 10:21:57 +01:00
|
|
|
radius: 0.25em,
|
|
|
|
)
|
2024-01-02 05:03:29 +01:00
|
|
|
|
2024-01-10 21:22:29 +01:00
|
|
|
// highlight important terms in bold
|
|
|
|
show raw: it => {
|
|
|
|
// avoid making terms in codeblocks bold
|
|
|
|
show terms: terminate-recursion
|
|
|
|
it
|
|
|
|
}
|
|
|
|
show terms: strong
|
|
|
|
|
|
|
|
// color codeblocks
|
|
|
|
// haskell hl seems to work ok for this
|
|
|
|
show raw.where(lang: "iowo", block: true): it => {
|
|
|
|
raw(it.text, lang: "haskell", block: true)
|
|
|
|
}
|
|
|
|
|
2024-01-02 05:03:29 +01:00
|
|
|
// document title
|
|
|
|
if title != none {
|
|
|
|
align(
|
|
|
|
right,
|
|
|
|
text(..fonts.title, title)
|
|
|
|
+ v(-12pt)
|
|
|
|
+ text(..fonts.subtitle, subtitle)
|
|
|
|
)
|
2024-01-01 23:34:34 +01:00
|
|
|
|
2024-01-02 05:03:29 +01:00
|
|
|
v(0.25cm)
|
|
|
|
}
|
2024-01-01 23:34:34 +01:00
|
|
|
|
2024-01-10 21:22:29 +01:00
|
|
|
// outline and other prelude info
|
|
|
|
outline(
|
|
|
|
indent: auto,
|
|
|
|
fill: line(
|
|
|
|
length: 100%,
|
|
|
|
stroke: (
|
|
|
|
cap: "round",
|
|
|
|
join: "round",
|
|
|
|
thickness: 0.5pt,
|
|
|
|
paint: luma(75%),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
2024-01-02 05:03:29 +01:00
|
|
|
// content itself
|
2024-01-01 23:34:34 +01:00
|
|
|
doc
|
|
|
|
}
|