docs: retab from tabs to 2 spaces
This commit is contained in:
parent
77d1236720
commit
d1001ad90d
2 changed files with 74 additions and 74 deletions
|
@ -7,69 +7,69 @@
|
|||
// - `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),
|
||||
cetz.canvas({
|
||||
// any preamble-ish stuff can go here
|
||||
set-style(
|
||||
mark: (angle: 90deg),
|
||||
stroke: (cap: "round", join: "round"),
|
||||
)
|
||||
)
|
||||
|
||||
what
|
||||
})
|
||||
what
|
||||
})
|
||||
})
|
||||
|
||||
#let canvas(what) = {
|
||||
align(center, graphic(what))
|
||||
align(center, graphic(what))
|
||||
}
|
||||
|
||||
|
||||
// smaller stuff
|
||||
|
||||
#let arrow(length: 0.4cm, lift: 3pt, stroke: 1pt) = graphic({
|
||||
line((0, lift), (rel: (length, 0)), mark: (end: ">", stroke: stroke))
|
||||
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)
|
||||
// hack for the bounding box bottom
|
||||
// so that `lift` even has any effect
|
||||
line((0, 0), (0, 0), stroke: none)
|
||||
})
|
||||
|
||||
// larger stuff
|
||||
|
||||
#let sequence(
|
||||
distance: 3cm,
|
||||
arrow-spacing: 0.15cm,
|
||||
// cetz will support rounded rects in 0.2.0
|
||||
style: (frame: "rect", padding: 0.1cm),
|
||||
..labels,
|
||||
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()
|
||||
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)
|
||||
}
|
||||
// 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: ">"),
|
||||
)
|
||||
}
|
||||
// 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({
|
||||
sequence(
|
||||
[Source],
|
||||
[Graph IR],
|
||||
[Runtime],
|
||||
)
|
||||
sequence(
|
||||
[Source],
|
||||
[Graph IR],
|
||||
[Runtime],
|
||||
)
|
||||
})
|
||||
|
||||
// A few commands to help demonstration in the docs.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue