- Merges [16](https://github.com/swaits/typst-collection/pull/16).
- Fixes [3](https://github.com/swaits/typst-collection/issues/3).
A big PR from [@eltos](https://github.com/eltos)!
This adds labels for each `key`, so that auto-complete (in the typst.app
/ `typst-ide`) works properly. It also makes it so terms can link to
their glossary entry. In the case that terms are used but no glossary is
shown (which is a core feature of Glossy), placeholder labels are used
so that the auto-complete still works.
All tests, but one (theme-gallery), passed straight from the PR. The
ddiff in the `theme-gallery` test were non-visible (ie a few pixels),
making it effectively passing too. Updated that test so it passes, and
updated the theme screenshot to match its output as well.
Huge thanks to [@eltos](https://github.com/eltos) who demonstrates a
deep understanding of Typst!
- Uniqfies the duplicate term usage tracking via counter + state to just using the counter. Refreactor the code with the two methods "mark_term_used" and "is_term_used".
- Adds a label with the entry key for autocompletion
- either in the glossary (if it is visible and there is a corresponding entry)
- or invisible during init-glossary
- Use a single label for all usages of the entry in the text. This simplifies the back-referencing logic significantly and also avoids cluttering the auto-complete list
closes https://github.com/swaits/typst-collection/issues/3
## New features:
**Articles with `a`/`an` modifier**
Now you can include articles using this new modifier. The articles may
be defined in your dictionary entry (fields `artcile`, and
`longarticle`). But, if you don't define them, Glossy will do a
reasonably good job at guessing them.
This modifier is also allowed before the term. For example, you might
have this term:
```yaml
www: Worldwide Web
```
And you could display it with an article by any of these:
```typst
@a:www
@an:www
@www:a
@www:an
```
These, `a` and `an` are exactly equivalent. They're just provided for
your convenience. Use either or both.
The `a`/`an` modifier works with all modifiers except `pl` and
`def`/`desc`.
If you want to define custom articles for your terms, do so like this:
```typst
#let glossary = (
rf: (
short: "RF",
article: "an",
long: "radio frequency",
longarticle: "a",
)
uts: (
short: "UTS",
article: "a",
long: "untranslatable string",
longarticle: "an",
)
)
```
But again, in most cases (for English) you shouldn't need to because
Glossy should usually get it right.
Fixes [#12](https://github.com/swaits/typst-collection/issues/12).
## Other changes:
- added test which exhausts all reference options
- added panic if 'def'/'desc' used when no `description` field exists
- significantly improved the (English) pluralizer function
- `__gls()` function refactored, cleaned up
- removed a rogue PDF
## Contributors:
- [@eltos](https://github.com/eltos)
- [@theRealProHacker](https://github.com/theRealProHacker)
Breaking changes:
- change input to dictionary of dictionaries instead of array of dictionaries
New features:
- add @term:def/@term:desc to display description
- add two new themes, theme-basic and theme-compact
Chores, fixes:
- copy 0.1.2 over to 0.2.0
- bump versions to 0.2.0 in all code/docs
- make __pluralize handle 'none' input
- document and refactor code
- update README.md
- rename theme-2col -> theme-twocol