Select Git revision
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
sheet_template.typ 1.64 KiB
#let apply-template(title, lang, doc) = {
import "global.typ": *
import "@preview/codly:1.0.0": *
set document(title: title.replace("\n", " - "), author: "Lars Frost")
set page(
paper: "a4",
numbering: "1",
footer: context [
#{sym.copyright} 2024 Lars Frost, Licensed under GPL-3.0-or-later. #link("https://git.fsmpi.rwth-aachen.de/osak/git-workshop")[Source]
#h(1fr)
#counter(page).display()
],
)
set par(leading: 0.6em, justify: true)
set par(spacing: 1.2em)
show heading: set block(above: 2.2em, below: 1em)
show link: it => {
set text(fill: blue)
underline(it)
}
set heading(numbering: "1.1")
show: codly-init.with()
codly(number-format: none, zebra-fill: none)
show table.header: strong
show raw.where(block: false): r => {
let e = 0.25em
let f = "DejaVu Sans Mono" // I think this is the default mono font. See https://github.com/typst/typst/issues/2870
// highlight(fill: gray, radius: 3pt, extent: e, {
// h(e)
// text(font: f, r)
// h(e)
// })
box(inset: (x: e, y: e), fill: hightlightBgColor, radius: 3pt, baseline: e, text(font: f, r))
}
show figure.caption: it => block({
layout(size => {
// Add borders, so the caption is better distinguishable from the below paragraph.
grid(columns: (0.02 * size.width, auto, 0.02 * size.width),
[],
align(center, {
block({
align(left, {
strong[#it.supplement #context(it.counter.display(it.numbering))#it.separator]
it.body
})
})
}),
[],
)
})
})
set text(lang: lang)
align(center, [
#text(17pt)[
*#title*
]\
#text(13pt)[
#datetime.today().display()
]
])
doc
}