forked from HEL/chronos
38 lines
720 B
Typst
38 lines
720 B
Typst
#import "@preview/cetz:0.2.2": draw
|
|
#import "consts.typ": *
|
|
|
|
#let PAR-SPECIALS = "?[]"
|
|
|
|
#let _par(name, display-name: auto, from-start: true, invisible: false) = {
|
|
return ((
|
|
type: "par",
|
|
name: name,
|
|
display-name: if display-name == auto {name} else {display-name},
|
|
from-start: from-start,
|
|
invisible: invisible
|
|
),)
|
|
}
|
|
|
|
#let _exists(participants, name) = {
|
|
if name == "?" or name == "[" or name == "]" {
|
|
return true
|
|
}
|
|
|
|
for p in participants {
|
|
if name == p.name {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
#let render(x-pos, p, y: 0) = {
|
|
draw.content(
|
|
(x-pos.at(p.i), y),
|
|
p.display-name,
|
|
name: p.name,
|
|
frame: "rect",
|
|
padding: PAR-PAD,
|
|
anchor: "south"
|
|
)
|
|
} |