mirror of
https://forge.katzen.cafe/katzen-cafe/iowo.git
synced 2024-11-24 14:28:44 +01:00
docs: move config from design to template
This commit is contained in:
parent
bebf2a97a4
commit
221ca09961
|
@ -2,76 +2,9 @@
|
||||||
#import "graphics.typ"
|
#import "graphics.typ"
|
||||||
#import graphics: arrow
|
#import graphics: arrow
|
||||||
|
|
||||||
#show: conf.with(title: [iOwO design], subtitle: [don't worry, we're just dreaming])
|
#show: conf.with(
|
||||||
|
title: [iOwO design],
|
||||||
// highlight important terms in bold
|
subtitle: [don't worry, we're just dreaming],
|
||||||
#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",
|
|
||||||
)
|
|
||||||
#let terms-trigger = regex(terms.map(expand).join("|"))
|
|
||||||
#show raw: it => {
|
|
||||||
// avoid making terms in codeblocks bold
|
|
||||||
show terms-trigger: terminate-recursion
|
|
||||||
it
|
|
||||||
}
|
|
||||||
#show terms-trigger: 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)
|
|
||||||
}
|
|
||||||
|
|
||||||
// actual content lol
|
|
||||||
|
|
||||||
#outline(
|
|
||||||
indent: auto,
|
|
||||||
fill: line(
|
|
||||||
length: 100%,
|
|
||||||
stroke: (
|
|
||||||
cap: "round",
|
|
||||||
join: "round",
|
|
||||||
thickness: 0.5pt,
|
|
||||||
paint: luma(75%),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
= Type data model
|
= Type data model
|
||||||
|
@ -107,7 +40,7 @@ However, this also makes the architecture somewhat more complicated. So here we
|
||||||
open base.png >|
|
open base.png >|
|
||||||
open stencil.png >|
|
open stencil.png >|
|
||||||
mask
|
mask
|
||||||
|> show12
|
|> show
|
||||||
|> (invert | show)
|
|> (invert | show)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,49 @@
|
||||||
heading: (font: "Montserrat", weight: "regular"),
|
heading: (font: "Montserrat", weight: "regular"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
#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("|"))
|
||||||
|
|
||||||
#let conf(
|
#let conf(
|
||||||
title: none,
|
title: none,
|
||||||
subtitle: none,
|
subtitle: none,
|
||||||
|
@ -44,6 +87,20 @@
|
||||||
radius: 0.25em,
|
radius: 0.25em,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 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)
|
||||||
|
}
|
||||||
|
|
||||||
// document title
|
// document title
|
||||||
if title != none {
|
if title != none {
|
||||||
align(
|
align(
|
||||||
|
@ -56,6 +113,20 @@
|
||||||
v(0.25cm)
|
v(0.25cm)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// outline and other prelude info
|
||||||
|
outline(
|
||||||
|
indent: auto,
|
||||||
|
fill: line(
|
||||||
|
length: 100%,
|
||||||
|
stroke: (
|
||||||
|
cap: "round",
|
||||||
|
join: "round",
|
||||||
|
thickness: 0.5pt,
|
||||||
|
paint: luma(75%),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
// content itself
|
// content itself
|
||||||
doc
|
doc
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue