Skip to content

Commit

Permalink
Add glossary
Browse files Browse the repository at this point in the history
  • Loading branch information
sitandr committed Sep 15, 2024
1 parent a1e6a15 commit 69c5bec
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
- [Tables](./packages/tables.md)
- [Code](./packages/code.md)
- [Presentations](./packages/presentation.md)
- [Glossary](./packages/glossary.md)
- [Themes]()
- [Layout](./packages/layout.md)
- [Wrapping figures](./packages/wrapping.md)
Expand Down
68 changes: 68 additions & 0 deletions src/packages/glossary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Glossary

## glossarium

>[Link to the universe](https://typst.app/universe/package/glossarium)
Package to manage glossary and abbreviations.

<div class="info">One of the very first cool packages of Typst, made specially for (probably) the first thesis written in Typst.<div>

```typ
#import "@preview/glossarium:0.4.1": make-glossary, print-glossary, gls, glspl
#show: make-glossary
// for better link visibility
#show link: set text(fill: blue.darken(60%))
#print-glossary(
(
// minimal term
(key: "kuleuven", short: "KU Leuven"),
// a term with a long form and a group
(key: "unamur", short: "UNamur", long: "Namur University", group: "Universities"),
// a term with a markup description
(
key: "oidc",
short: "OIDC",
long: "OpenID Connect",
desc: [OpenID is an open standard and decentralized authentication protocol promoted by the non-profit
#link("https://en.wikipedia.org/wiki/OpenID#OpenID_Foundation")[OpenID Foundation].],
group: "Accronyms",
),
// a term with a short plural
(
key: "potato",
short: "potato",
// "plural" will be used when "short" should be pluralized
plural: "potatoes",
desc: [#lorem(10)],
),
// a term with a long plural
(
key: "dm",
short: "DM",
long: "diagonal matrix",
// "longplural" will be used when "long" should be pluralized
longplural: "diagonal matrices",
desc: "Probably some math stuff idk",
),
)
)
// referencing the OIDC term using gls
#gls("oidc")
// displaying the long form forcibly
#gls("oidc", long: true)
// referencing the OIDC term using the reference syntax
@oidc
Plural: #glspl("potato")
#gls("oidc", display: "whatever you want")
```

0 comments on commit 69c5bec

Please sign in to comment.