docs: rework template and add stages framework
This commit is contained in:
parent
8f790af8a1
commit
e2e4c2c29f
5 changed files with 152 additions and 22 deletions
79
docs/design/graphics.typ
Normal file
79
docs/design/graphics.typ
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
#import "@preview/cetz:0.1.2"
|
||||||
|
#import cetz.draw: *
|
||||||
|
|
||||||
|
// quick reference
|
||||||
|
// - `graphic` is for inline icons/images
|
||||||
|
// - `canvas` is for centered more prominent stuff
|
||||||
|
// - `group` can be used in either of ^, but not standalone
|
||||||
|
|
||||||
|
#let graphic(what) = box({
|
||||||
|
cetz.canvas({
|
||||||
|
// any preamble-ish stuff can go here
|
||||||
|
set-style(
|
||||||
|
mark: (angle: 90deg)
|
||||||
|
)
|
||||||
|
|
||||||
|
what
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
#let canvas(what) = {
|
||||||
|
align(center, graphic(what))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// smaller stuff
|
||||||
|
|
||||||
|
#let arrow(length: 1cm, lift: 4pt, stroke: 1pt) = graphic({
|
||||||
|
line((0, lift), (rel: (length, 0)), mark: (end: ">", stroke: stroke))
|
||||||
|
|
||||||
|
// hack for the bounding box bottom
|
||||||
|
// so that `lift` even has any effect
|
||||||
|
line((0, 0), (0, 0), stroke: none)
|
||||||
|
})
|
||||||
|
|
||||||
|
// larger stuff
|
||||||
|
|
||||||
|
#let nodes(
|
||||||
|
distance: 3cm,
|
||||||
|
arrow-spacing: 0.15cm,
|
||||||
|
// cetz will support rounded rects in 0.2.0
|
||||||
|
style: (frame: "rect", padding: 0.1cm),
|
||||||
|
..labels,
|
||||||
|
) = group({
|
||||||
|
let labels = labels.pos()
|
||||||
|
|
||||||
|
// draw each label itself
|
||||||
|
for (i, label) in labels.enumerate() {
|
||||||
|
if i != 0 {
|
||||||
|
set-origin((distance, 0))
|
||||||
|
}
|
||||||
|
content((0, 0), name: "label-" + str(i), label, ..style)
|
||||||
|
}
|
||||||
|
|
||||||
|
// then draw an arrow from each to each
|
||||||
|
// since an arrow is between two, the last one can't be connected with the "next-to-last" one
|
||||||
|
// so we leave it out
|
||||||
|
for i in range(labels.len() - 1) {
|
||||||
|
line(
|
||||||
|
(rel: (arrow-spacing, 0), to: "label-" + str(i) + ".right"),
|
||||||
|
(rel: (-arrow-spacing, 0), to: "label-" + str(i + 1) + ".left"),
|
||||||
|
mark: (end: ">"),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
#let stages-overview = canvas({
|
||||||
|
nodes(
|
||||||
|
[Source],
|
||||||
|
[Graph IR],
|
||||||
|
[Optimizer],
|
||||||
|
[Compiler],
|
||||||
|
[VM Bytecode],
|
||||||
|
[VM],
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
// literally just for standalone display of the graphics alone
|
||||||
|
#import "../template.typ": conf
|
||||||
|
#show: conf
|
31
docs/design/iowo-design.typ
Normal file
31
docs/design/iowo-design.typ
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
#import "../template.typ": conf
|
||||||
|
#import "graphics.typ"
|
||||||
|
|
||||||
|
#show: conf.with(title: [iOwO design], subtitle: [don't worry, we're just dreaming])
|
||||||
|
#show ">": graphics.arrow()
|
||||||
|
|
||||||
|
= Type data model
|
||||||
|
|
||||||
|
== Requirements
|
||||||
|
|
||||||
|
- Color-aware
|
||||||
|
- It can handle colors and colorspaces for images
|
||||||
|
- ocio????
|
||||||
|
- number/number type support
|
||||||
|
- custom types (structs/enums)
|
||||||
|
- algebraic enums
|
||||||
|
- traits (`Numeric`...)
|
||||||
|
|
||||||
|
= Execution stages
|
||||||
|
|
||||||
|
#graphics.stages-overview
|
||||||
|
|
||||||
|
== Source > Graph IR
|
||||||
|
|
||||||
|
== Graph IR > VM Bytecode
|
||||||
|
|
||||||
|
=== Optimizer
|
||||||
|
|
||||||
|
=== Compiler
|
||||||
|
|
||||||
|
== VM Bytecode > VM
|
|
@ -1,16 +0,0 @@
|
||||||
#import "../template.typ": conf
|
|
||||||
#show: doc => conf(
|
|
||||||
doc
|
|
||||||
)
|
|
||||||
|
|
||||||
= Type data model
|
|
||||||
|
|
||||||
== Requirements
|
|
||||||
|
|
||||||
- Color-aware
|
|
||||||
- It can handle colors and colorspaces for images
|
|
||||||
- ocio????
|
|
||||||
- number/number type support
|
|
||||||
- custom types (structs/enums)
|
|
||||||
- algebraic enums
|
|
||||||
- traits (`Numeric`...)
|
|
|
@ -1,12 +1,47 @@
|
||||||
|
// 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"),
|
||||||
|
)
|
||||||
|
|
||||||
#let conf(
|
#let conf(
|
||||||
doc
|
title: none,
|
||||||
|
subtitle: none,
|
||||||
|
doc,
|
||||||
) = {
|
) = {
|
||||||
set text(font: "Atkinson Hyperlegible");
|
set page(
|
||||||
show heading: it => [
|
numbering: "1 / 1",
|
||||||
#set text(font: "Montserrat", weight: "regular")
|
header: locate(loc => {
|
||||||
|
datetime.today().display()
|
||||||
|
|
||||||
#it
|
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")
|
||||||
|
|
||||||
|
show heading: it => text(..fonts.heading, it)
|
||||||
|
|
||||||
|
// document title
|
||||||
|
if title != none {
|
||||||
|
align(
|
||||||
|
right,
|
||||||
|
text(..fonts.title, title)
|
||||||
|
+ v(-12pt)
|
||||||
|
+ text(..fonts.subtitle, subtitle)
|
||||||
|
)
|
||||||
|
|
||||||
|
v(0.25cm)
|
||||||
|
}
|
||||||
|
|
||||||
|
// content itself
|
||||||
doc
|
doc
|
||||||
}
|
}
|
||||||
|
|
1
justfile
1
justfile
|
@ -3,3 +3,4 @@ docs:
|
||||||
typst compile $doc --root=docs; \
|
typst compile $doc --root=docs; \
|
||||||
mv "$(dirname $doc)/$(basename $doc .typ).pdf" docs/compiled/; \
|
mv "$(dirname $doc)/$(basename $doc .typ).pdf" docs/compiled/; \
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue