Skip to content

Commit 9e1a52c

Browse files
committed
Rename long to first, and always-long to always-first
1 parent 9579d20 commit 9e1a52c

File tree

14 files changed

+233
-120
lines changed

14 files changed

+233
-120
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## 0.5.10
4+
5+
> [!NOTE]
6+
> The changelog incorrectly states that `@gls:long` and `#gls("gls", long: true)` are the same.
7+
> The option `long` of `gls` and others similar functions has been renamed to `first`
8+
> to better reflect the real meaning of the option. (reported in #172 by @haenoe)
9+
> `make-glossary`'s option has been renamed from `always-long` to `always-first`.
10+
>
11+
> In fact, the long in `@gls:long` refers to the long attribute in the entry's
12+
> definition, whereas the long in `#gls(...)` refers to the "long form" of the
13+
> entry's output.
14+
15+
316
## 0.5.9
417

518
> [!TIP]

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,16 @@ After importing the package and before making any calls to `gls`, ` print-glossa
8787

8888
A term is a [dictionary](https://typst.app/docs/reference/types/dictionary/).
8989

90-
| Key | Type | Required/Optional | Description |
91-
| :------------ | :---------------- | :---------------- | :---------------------------------------------------------------------------------------------------------------------- |
92-
| `key` | string | required | Case-sensitive, unique identifier used to reference the term. |
93-
| `short` | string or content | semi-optional | The short form of the term replacing the term citation. |
94-
| `long` | string or content | semi-optional | The long form of the term, displayed in the glossary and on the first citation of the term. |
95-
| `description` | string or content | optional | The description of the term. |
96-
| `plural` | string or content | optional | The pluralized short form of the term. |
97-
| `longplural` | string or content | optional | The pluralized long form of the term. |
98-
| `group` | string | optional | Case-sensitive group the term belongs to. The terms are displayed by groups in the glossary. |
99-
| `custom` | any | optional | Custom content for usage in "user functions", e.g. `user-print-glossary` (see [advanced docs](./advanced-docs/main.pdf))|
90+
| Key | Type | Required/Optional | Description |
91+
| :------------ | :---------------- | :---------------- | :----------------------------------------------------------------------------------------------------------------------- |
92+
| `key` | string | required | Case-sensitive, unique identifier used to reference the term. |
93+
| `short` | string or content | semi-optional | The short form of the term replacing the term citation. |
94+
| `long` | string or content | semi-optional | The long form of the term, displayed in the glossary and on the first citation of the term. |
95+
| `description` | string or content | optional | The description of the term. |
96+
| `plural` | string or content | optional | The pluralized short form of the term. |
97+
| `longplural` | string or content | optional | The pluralized long form of the term. |
98+
| `group` | string | optional | Case-sensitive group the term belongs to. The terms are displayed by groups in the glossary. |
99+
| `custom` | any | optional | Custom content for usage in "user functions", e.g. `user-print-glossary` (see [advanced docs](./advanced-docs/main.pdf)) |
100100

101101

102102
```typ
@@ -187,15 +187,15 @@ Referencing terms can be done in different ways. The function with the largest f
187187
```typ
188188
// Referencing the OIDC term using gls
189189
#gls("oidc")
190-
// Displaying the long form forcibly
191-
#gls("oidc", long: true)
190+
// Displaying the first form forcibly
191+
#gls("oidc", first: true)
192192
// Do not add a link
193193
#gls("oidc", link: false)
194194
// Do not update the usage count. If done on first use, the next reference will trigger printing the full version.
195195
#gls("oidc", update: false)
196196
```
197197

198-
The graph below is an overview of the available interface groups and their individual functions/modifiers.
198+
The graph below is an overview of the available interface groups and their individual functions/modifiers.
199199

200200
```mermaid
201201
graph TD;
@@ -209,12 +209,12 @@ graph TD;
209209
gls --> at-syntax;
210210
```
211211

212-
Usually, you will want to use Typst reference syntax (`@` syntax). This is the most practical way to reference an entry. By default, some shorthands are made available: plural, capitalize, capitalized plural, short and long.
212+
Usually, you will want to use Typst reference syntax (`@` syntax). This is the most practical way to reference an entry. By default, some shorthands are made available: plural, capitalize, capitalized plural, short and long.
213213

214214
```typ
215215
// Prints the full version on first usage, short afterwards
216216
@oidc
217-
// Will always display the long version
217+
// Will always display the long version
218218
@oidc:long
219219
// Display the plural form
220220
@oidc:pl
@@ -233,11 +233,11 @@ print-glossary(
233233

234234
The different interfaces have different default parameters which you should keep in mind when using them. In most cases, you will not need to manually set `update: false`, unless you are using `gls` in situations that create ambiguity, e.g., using `gls` in other entries' description.
235235

236-
| Interface | `update` | `link` |
237-
| --------------------------------------------- | :------: | :-----: |
238-
| `gls`, `Gls`, `glspl`, etc. | `true` | `true` |
239-
| Access values<br>(`gls-short`, ...) | `false` | `false` |
240-
| Reference syntax<br>(`@oidc:pl`, ...) | `true` | `true` |
236+
| Interface | `update` | `link` |
237+
| ------------------------------------- | :------: | :-----: |
238+
| `gls`, `Gls`, `glspl`, etc. | `true` | `true` |
239+
| Access values<br>(`gls-short`, ...) | `false` | `false` |
240+
| Reference syntax<br>(`@oidc:pl`, ...) | `true` | `true` |
241241

242242
### Handling plurals
243243

@@ -333,7 +333,7 @@ Note that when using the `show ref` rule approach together with a **global** `sh
333333
Further customization is possible. Here is a short list of alternative functions you can pass to `print-glossary` to modify the layout.
334334

335335
- `user-print-glossary`: print the entire glossary
336-
- `user-print-group-heading`: print the group heading
336+
- `user-print-group-heading`: print the group heading
337337
- `user-group-break`: display a break between groups
338338
- `user-print-gloss`: print one entry
339339
- `user-print-title`: print the entry's title

examples/full-example/main.typ

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
short: "KU Leuven",
1010
long: "Katholieke Universiteit Leuven",
1111
longplural: "Katholieke Universiteiten Leuven",
12-
description: [Fugiat do fugiat est minim ullamco est eu duis minim nisi tempor adipisicing do _sunt_. #gls("vub")],
12+
description: [Fugiat do fugiat est minim ullamco est eu duis minim nisi
13+
tempor adipisicing do _sunt_. #gls("vub")],
1314
plural: "KU Leuvens",
1415
artshort: "the",
1516
artlong: "the",
@@ -30,9 +31,9 @@
3031
key: "vub",
3132
short: "VUB",
3233
long: "Vrije Universiteit Brussel",
33-
description: [Proident veniam non aliquip commodo sunt cupidatat. Enim est cupidatat occaecat
34-
elit et. Adipisicing irure id consequat ullamco non. Labore sunt tempor et
35-
mollit. #gls("kuleuven", long: true)],
34+
description: [Proident veniam non aliquip commodo sunt cupidatat. Enim est
35+
cupidatat occaecat elit et. Adipisicing irure id consequat ullamco non.
36+
Labore sunt tempor et mollit. #gls("kuleuven", first: true)],
3637
),
3738
(
3839
key: "ulb",
@@ -67,8 +68,8 @@
6768
(
6869
key: "notused",
6970
short: "Not used",
70-
description: [This key is not cited anywhere, it won't be in the glossary unless the
71-
`show-all` argument is set to true],
71+
description: [This key is not cited anywhere, it won't be in the glossary
72+
unless the `show-all` argument is set to true],
7273
),
7374
)
7475
#register-glossary(entry-list)
@@ -80,18 +81,25 @@
8081

8182
There are many Belgian universities, like @kuleuven and @ulb. When repeating
8283
their names, they won't show as a long version: @kuleuven, @ulb. But we can
83-
still force them to be long using the `gls` function: #gls("kuleuven", long: true).
84+
still force them to be long using the `gls` function: #gls(
85+
"kuleuven",
86+
first: true,
87+
).
8488

85-
We can also force them to be short: #gls("kuleuven", long: false). Finally, we
89+
We can also force them to be short: #gls("kuleuven", first: false). Finally, we
8690
can make them plural:
8791
+ using the `suffix` parameter: #gls("kuleuven", suffix: "s"), or
8892
+ using the additional `supplement` onto the `ref`: @kuleuven[s], or
8993
+ the plural function `#glspl(key: "kuleuven")` #glspl("kuleuven"), or
9094
+ call `@kuleuven:pl` @kuleuven:pl
9195

92-
It is also possible to use the proper article with `#agls("lod")`: "#agls("lod") system", "#agls("lod") system".
96+
It is also possible to use the proper article with `#agls("lod")`: "#agls("lod")
97+
system", "#agls("lod") system".
9398

94-
You can also override the text shown by setting the `display` argument: #gls("kuleuven", display: "whatever you want")
99+
You can also override the text shown by setting the `display` argument: #gls(
100+
"kuleuven",
101+
display: "whatever you want",
102+
)
95103

96104
Attributes of an entry can be retrieved using the available functions:
97105
- `gls-key("kuleuven")`: #gls-key("kuleuven")

tests/always-first/ref/1.png

7.7 KB
Loading
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#import "../../themes/default.typ": *
22

3-
== always-long
3+
== always-first
44

5-
#show: make-glossary.with(always-long: true)
5+
#show: make-glossary.with(always-first: true)
66
#let entry-list-8 = (
77
(
88
key: "short",

tests/always-long/ref/1.png

-7.78 KB
Binary file not shown.

tests/debug/ref/1.png

-658 Bytes
Loading

tests/debug/ref/2.png

646 Bytes
Loading

tests/debug/test.typ

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
key: "hidden potato",
3434
short: "hiddenpotato",
3535
group: "show-all test",
36-
description: [This potato does not appear, unless `print-glossary` is called with `show-all: true`],
36+
description: [This potato does not appear, unless `print-glossary` is called
37+
with `show-all: true`],
3738
),
3839
)
3940
#let entry-list-2 = (
@@ -156,11 +157,11 @@ First: #gls("potato")
156157

157158
Display: #gls("potato", display: "potato text")
158159

159-
Force long: #gls("potato", long: true)
160+
Force long: #gls("potato", first: true)
160161

161162
1st ref. when long is empty defaults to short: #gls("potato A")
162163

163-
Force long when empty defaults to short: #gls("potato A", long: true)
164+
Force long when empty defaults to short: #gls("potato A", first: true)
164165

165166
2nd ref.: #gls("potato A")
166167

@@ -170,9 +171,9 @@ Force long when empty defaults to short: #gls("potato A", long: true)
170171

171172
First: #glspl("potato C")
172173

173-
Force long: #glspl("potato", long: true)
174+
Force long: #glspl("potato", first: true)
174175

175-
Force long when empty defaults to plural: #glspl("potato A", long: true)
176+
Force long when empty defaults to plural: #glspl("potato A", first: true)
176177

177178
2nd ref.: #glspl("potato A")
178179

@@ -229,8 +230,7 @@ Only list 4: #context count-all-refs(entry-list: entry-list-4)
229230
== #there-are-refs
230231

231232
true: #context there-are-refs()
232-
)
233-
false: #context there-are-refs(groups: (" ",))
233+
) false: #context there-are-refs(groups: (" ",))
234234

235235
#context if there-are-refs(entry-list: ((key: "potato A"),)) [
236236
There are refs to potato A in the document.

0 commit comments

Comments
 (0)