Files
TB-Docs/report/utils.typ

43 lines
844 B
Typst

#let include-offset(what) = context {
let current-offset = heading.offset
set heading(offset: current-offset + 1)
include what
}
#let quote-block(width: 10cm, who, what) = {
set par(justify: false)
align(
right,
block(
width: width,
inset: (bottom: 1cm),
quote(
attribution: who,
block: true,
what
)
)
)
}
#let _fn-links = state("_fn-links", ())
#let fn-link(lbl, url, body) = context {
link(url, body)
let links = _fn-links.get()
let name = str(lbl)
if name in links {
footnote(lbl)
} else {
[#footnote(link(url)) #lbl]
_fn-links.update(links => links + (name,))
}
}
#let code-ref(lbl, path, body: auto) = {
if body == auto {
body = path
}
let url = "https://git.kb28.ch/HEL/midas/src/branch/main/" + path
fn-link(lbl, url, body)
}