From 221ca09961a8244745bc3eee1b48e338fa489867 Mon Sep 17 00:00:00 2001 From: MultisampledNight Date: Wed, 10 Jan 2024 21:22:29 +0100 Subject: [PATCH] docs: move config from design to template --- docs/design/iowo-design.typ | 75 ++----------------------------------- docs/template.typ | 71 +++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 71 deletions(-) diff --git a/docs/design/iowo-design.typ b/docs/design/iowo-design.typ index e5f07f7..9646ab8 100644 --- a/docs/design/iowo-design.typ +++ b/docs/design/iowo-design.typ @@ -2,76 +2,9 @@ #import "graphics.typ" #import graphics: arrow -#show: conf.with(title: [iOwO design], subtitle: [don't worry, we're just dreaming]) - -// highlight important terms in bold -#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%), - ), - ), +#show: conf.with( + title: [iOwO design], + subtitle: [don't worry, we're just dreaming], ) = Type data model @@ -107,7 +40,7 @@ However, this also makes the architecture somewhat more complicated. So here we open base.png >| open stencil.png >| mask -|> show12 +|> show |> (invert | show) ``` diff --git a/docs/template.typ b/docs/template.typ index 899ab30..23216db 100644 --- a/docs/template.typ +++ b/docs/template.typ @@ -8,6 +8,49 @@ 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( title: none, subtitle: none, @@ -44,6 +87,20 @@ 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 if title != none { align( @@ -56,6 +113,20 @@ 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 doc }