Skip to content

Commit

Permalink
Merge pull request #28 from ENIB-Community/preparing-release-0.3.0
Browse files Browse the repository at this point in the history
Preparing release 0.3.0
  • Loading branch information
slashformotion authored Apr 7, 2024
2 parents 294da4c + 24def13 commit 8c93cb7
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 11 deletions.
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,27 @@ After importing the package and before making any calls to `gls`,` print-glossar
First we have to define the terms.
A term is a [dictionary](https://typst.app/docs/reference/types/dictionary/) composed of 2 required and 2 optional elements:

- `key` (string) *required*: used to make reference to the term.
- `key` (string) *required, case-sensitive, unique*: used to reference the term.
- `short` (string) *required*: the short form of the term replacing the term citation.
- `long` (string or content) *optional*: The long form of the term, displayed in the glossary and on the first citation of the term.
- `desc` (string or content) *optional*: The description of the term.
- `group` (string) *optional, case-sensitive*: The group the term belongs to. The terms are displayed by groups in the glossary.

Then the terms are passed as a list to `print-glossary`

```ts
#print-glossary((
// minimal term
(key: "kuleuven", short: "KU Leuven"),
// a term with a long form
(key: "unamur", short: "UNamur", long: "Université de Namur"),
// a term with a long form and a group
(key: "unamur", short: "UNamur", long: "Namur University", group: "Universities"),
// another one but formated differently
(
key: "umons",
short: "UMons",
long: "Mons University",
group: "Universities"
),
// no long form here
(key: "kdecom", short: "KDE Community", desc:"An international team developing and distributing Open Source software."),
// a full term with description containing markup
Expand All @@ -60,15 +68,20 @@ Then the terms are passed as a list to `print-glossary`
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].]),
#link("https://en.wikipedia.org/wiki/OpenID#OpenID_Foundation")[OpenID Foundation].]
group: "Accronyms",
),
))
```

By default, the terms that are not referenced in the document are not shown in the glossary, you can force their appearance by setting the `show-all` argument to true.

You can also disable the back-references by setting the parameter `disable-back-references` to `true`.

You can call this function from anywhere.
Group page breaks can be enable by setting the parameter `enable-group-pagebreak` to `true`.

You can call this function from anywhere in you document.


### Referencing terms.

Expand Down Expand Up @@ -113,6 +126,10 @@ I recommend setting a show rule for the links to that your reader understand tha

## Changelog

### 0.3.0

- Introducing support for grouping terms in the glossary. Use the optional and case-sensitive key `group` to assign terms to specific groups. The appearanceof the glossary can be customized with the new parameter `enable-group-pagebreak`, allowing users to insert page breaks between groups for better organization. These enhancements were contributed by [indicatelovelace](https://github.com/indicatelovelace).

### 0.2.6

#### Added
Expand Down
2 changes: 1 addition & 1 deletion examples/groups/groups.typ
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ Reference to @bor

),
show-all: true,
group-pagebreak: true, // break page for each group
enable-group-pagebreak: true, // break page for each group
)
4 changes: 2 additions & 2 deletions glossarium.typ
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ SOFTWARE.*/
return new-list
}

#let print-glossary(entry_list, show-all: false, disable-back-references: false, group-pagebreak: false) = {
#let print-glossary(entry_list, show-all: false, disable-back-references: false, enable-group-pagebreak: false) = {
let entries = __normalize-entry-list(entry_list)
__glossary_entries.update(x => {
for entry in entry_list {
Expand Down Expand Up @@ -146,6 +146,6 @@ SOFTWARE.*/
]
}
}
if group-pagebreak {pagebreak(weak: true)}
if enable-group-pagebreak {pagebreak(weak: true)}
}
};
5 changes: 2 additions & 3 deletions tbump.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Uncomment this if your project is hosted on GitHub:
github_url = "https://github.com/ENIB-Community/glossarium/"

[version]
Expand Down Expand Up @@ -36,8 +35,8 @@ src = "examples/full-example/main.typ"

[[before_commit]]
name = "compile examples"
cmd = "make "
cmd = "just build-examples"

[[after_push]]
name = "Create local version of package"
cmd = "make local"
cmd = "just local"

0 comments on commit 8c93cb7

Please sign in to comment.