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 = (
|
2024-01-11 13:55:51 +01:00
|
|
|
main: (font: atk, size: 12pt),
|
2024-01-02 05:03:29 +01:00
|
|
|
|
2024-01-11 13:55:51 +01:00
|
|
|
title: (font: atk, size: 20pt),
|
|
|
|
subtitle: (font: atk, size: 10pt),
|
|
|
|
heading: (font: "Montserrat", weight: "regular"),
|
2024-01-02 05:03:29 +01:00
|
|
|
)
|
|
|
|
|
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 = (
|
2024-01-21 22:11:41 +01:00
|
|
|
"processing stage",
|
2024-01-10 21:22:29 +01:00
|
|
|
"source",
|
|
|
|
"AST",
|
|
|
|
"graph IR",
|
|
|
|
"runtime",
|
|
|
|
|
|
|
|
"optimizer",
|
|
|
|
"scheduler",
|
2024-01-21 22:11:41 +01:00
|
|
|
"evaluator",
|
|
|
|
"evaluation",
|
2024-01-10 21:22:29 +01:00
|
|
|
|
2024-01-11 11:51:03 +01:00
|
|
|
"function",
|
2024-01-10 21:34:52 +01:00
|
|
|
"instruction",
|
2024-01-10 21:22:29 +01:00
|
|
|
"input", "argument", "consumer",
|
|
|
|
"output", "streamer",
|
|
|
|
"modifier",
|
2024-01-21 22:11:41 +01:00
|
|
|
"pipeline",
|
2024-01-10 21:22:29 +01:00
|
|
|
)
|
2024-01-10 21:28:01 +01:00
|
|
|
// yes, the shadowing is intentional to avoid accidentally using the list
|
|
|
|
#let terms = regex("\\b(" + terms.map(expand).join("|") + ")\\b")
|
2024-01-10 21:22:29 +01:00
|
|
|
|
2024-01-01 23:34:34 +01:00
|
|
|
#let conf(
|
2024-01-11 13:55:51 +01:00
|
|
|
title: none,
|
|
|
|
subtitle: none,
|
2024-01-11 14:01:29 +01:00
|
|
|
render-outline: true,
|
2024-01-11 13:55:51 +01:00
|
|
|
doc,
|
2024-01-01 23:34:34 +01:00
|
|
|
) = {
|
2024-01-11 13:55:51 +01:00
|
|
|
set page(
|
|
|
|
numbering: "1 / 1",
|
|
|
|
margin: 3.25cm,
|
|
|
|
header: locate(loc => {
|
|
|
|
datetime.today().display()
|
2024-01-02 05:03:29 +01:00
|
|
|
|
2024-01-11 13:55:51 +01:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
)
|
2024-01-10 21:39:21 +01:00
|
|
|
set par(justify: true)
|
2024-01-11 13:55:51 +01:00
|
|
|
set text(..fonts.main)
|
|
|
|
set heading(numbering: "A.1")
|
2024-01-02 05:03:29 +01:00
|
|
|
|
2024-01-11 13:55:51 +01:00
|
|
|
show heading: it => text(..fonts.heading, it)
|
2024-01-10 21:54:29 +01:00
|
|
|
// color links
|
|
|
|
show link: text.with(fill: blue)
|
|
|
|
// prettify codeblocks
|
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-10 21:39:21 +01:00
|
|
|
show raw.where(block: true): it => {
|
|
|
|
// don't try to put codeblocks into blocktext
|
|
|
|
set par(justify: false)
|
|
|
|
it
|
|
|
|
}
|
2024-01-02 05:03:29 +01:00
|
|
|
|
2024-01-10 21:54:29 +01:00
|
|
|
// semi-strategically place pagebreaks for better orientation
|
|
|
|
let pagebreak-before(it) = pagebreak() + it
|
|
|
|
show heading.where(outlined: true): it => {
|
|
|
|
if it.level <= 2 {
|
2024-01-10 21:58:51 +01:00
|
|
|
pagebreak(weak: true)
|
2024-01-10 21:54:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
it
|
|
|
|
}
|
|
|
|
|
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-11 13:55:51 +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-11 13:55:51 +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
|
2024-01-11 14:01:29 +01:00
|
|
|
if render-outline {
|
|
|
|
outline(
|
|
|
|
indent: auto,
|
|
|
|
fill: line(
|
|
|
|
length: 100%,
|
|
|
|
stroke: (
|
|
|
|
cap: "round",
|
|
|
|
join: "round",
|
|
|
|
thickness: 0.5pt,
|
|
|
|
paint: luma(75%),
|
|
|
|
),
|
2024-01-10 21:22:29 +01:00
|
|
|
),
|
2024-01-11 14:01:29 +01:00
|
|
|
)
|
|
|
|
}
|
2024-01-10 21:22:29 +01:00
|
|
|
|
2024-01-11 13:55:51 +01:00
|
|
|
// content itself
|
|
|
|
doc
|
2024-01-01 23:34:34 +01:00
|
|
|
}
|