Files
swaits 93a7794c2e fix(glossy): fix forward linking (broken themes)
Fixes [#19](https://github.com/swaits/typst-collection/issues/19).

Themes must emit `entry.label` for terms to be able to forward-link to
their glossary entrie.
2025-01-07 22:54:43 -07:00

33 lines
732 B
Typst

// A tabular theme courtesy of [@Fevol](https://github.com/Fevol)
#let theme-table = (
section: (title, body) => {
heading(level: 1, title)
body
},
group: (name, index, total, body) => {
if name != "" and total > 1 {
heading(level: 2, name)
}
table(columns: 4,
stroke: none,
inset: (x, y) => {
if (x == 0) {
(left: 0pt, rest: 5pt)
} else if (x == 3) {
(right: 0pt, rest: 5pt)
} else {
5pt
}
},
table.header([*Abbreviation*], [*Full Name*], [*Description*], [*Pages*]),
..body
)
},
entry: (entry, index, total) => {
(entry.short + entry.label, entry.long, entry.description, entry.pages)
}
)