feat: write template
This commit is contained in:
commit
a0a6d2cf84
98 files changed
+6609
No files matched your search
@@ -0,0 +1,51 @@
|
||||
#let _glossaryDict = state("e8759020-8d68-4920-9ce6-246b09c3094b", none)
|
||||
|
||||
#let setDefaults(defaults) = {
|
||||
_glossaryDict.update(dict => {
|
||||
for (term, explanation) in defaults.pairs() {
|
||||
dict.insert(term, explanation)
|
||||
}
|
||||
return dict
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
#let term(term, explanation) = {
|
||||
_glossaryDict.update(dict => {
|
||||
if dict == none {
|
||||
return (
|
||||
"" + term: explanation,
|
||||
)
|
||||
}
|
||||
dict.insert(term, explanation)
|
||||
return dict
|
||||
})
|
||||
term
|
||||
}
|
||||
|
||||
#let glossary() = {
|
||||
context {
|
||||
if _glossaryDict.get() == none {
|
||||
return
|
||||
}
|
||||
[ = Glossar]
|
||||
terms(tight: true)
|
||||
figure(
|
||||
table(
|
||||
columns: (1fr, 3fr),
|
||||
table.header([Begriff], [Bedeutung]),
|
||||
|
||||
.._glossaryDict
|
||||
.get()
|
||||
.keys()
|
||||
.sorted(key: lower)
|
||||
.map(key => (
|
||||
key,
|
||||
_glossaryDict.get().at(key),
|
||||
))
|
||||
.flatten(),
|
||||
),
|
||||
caption: [Glossar],
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user