Commit Graph
100 Commits
Author SHA1 Message Date
swaits f8085fc768 test(glossy): update glossarium version in test to latest
This was caught by a lint when pushing up to the typst-packages repo.
2025-10-26 16:00:24 -06:00
swaits e262a2eafe chore(glossy): bump version to 0.9.0 2025-10-26 16:00:24 -06:00
swaits 022892df88 chore(glossy): format with typestyle 2025-10-26 16:00:23 -06:00
swaits 6d83a858c8 chore(glossy): bump copyright year in LICENSE 2025-10-26 16:00:23 -06:00
swaits bacb6cebd1 chore(glossy): add justfile, update .gitignore 2025-10-26 16:00:23 -06:00
swaits 279217dfd2 Merge pull request #55 from th1j5/main
Formalize & document glossy behaviour, simplify internals and add some features
2025-10-26 16:00:23 -06:00
swaits 8b98b9e89f refactor(glossy): Simplify the mode selection
The selection of which mode was shown was pretty complex. This is now
simplified.

First, when the mode is `auto`, the requested mode is adapted depending
on the first use counter.
Then, it is determined if the requested mode can be fulfilled or if a
fallback mode should be selected.

After this simple process, the mode is determined.
Based on #47 from BurningKarl
2025-10-26 16:00:23 -06:00
swaits 9972b93b52 feat(glossy): Add reset mode
Add the `reset` mode, in accordance with the documentation.
(updated in bffe5fdc35fcb67aca188fc0642db5bf23530bcd!)
2025-10-26 16:00:23 -06:00
swaits ae6405c288 feat(glossy): Check validity of modifiers
When an unrecognized modifier is applied, glossy should panic to warn
the user, instead of silently ignoring the modifier. This might catch
potential misspellings of modifiers.
2025-10-26 16:00:23 -06:00
swaits a6572d07ff feat(glossy): Panic on multiple requested modes
When multiple modes are requested at the same time
(like 'long' & 'short'), panic with a clear error message.

This is better than guessing what the user wanted.
2025-10-26 16:00:23 -06:00
swaits 8e3ede34dc refactor(glossy): Sanitize modes & modifiers
The list of modes & modifiers is now normalized (i.e. multiple equal
names are mapped to the same internal name, e.g. 'def' and 'desc' are
mapped to 'description').
Some sanitization is applied (not yet rigorously).

The internals are now splitted in a list of modes and a list of
modifiers.

These two actions already simplify a lot of logic (no multiple checks
for 'def' and 'desc' for example).
2025-10-26 16:00:23 -06:00
swaits c8f2c0d975 fixup! docs(glossy): Document modes vs modifiers 2025-10-26 16:00:22 -06:00
swaits a2947f2b7b feat(glossy): Count both mode as first use
A breaking change, by default the `both` mode now counts towards the
first use of a term. This in accordance to the documentation.
(updated in bffe5fdc35fcb67aca188fc0642db5bf23530bcd!)
2025-10-26 16:00:22 -06:00
swaits f745af74cc feat(glossy): Add use and nouse modifiers
Added the `:use`/`:spend` and `:nouse`/`:nospend` modifiers, in
accordance with the documentation.
(updated in bffe5fdc35fcb67aca188fc0642db5bf23530bcd!)
2025-10-26 16:00:22 -06:00
swaits 9de06d3781 feat(glossy): Decouple 'wants reference' from 'first usage'
The 'wants to be referenced from the index/glossary' counter is now
decoupled from the '(first) usage' counter. This is made consistent with
the documentation (updated in bffe5fdc35fcb67aca188fc0642db5bf23530bcd!).

Furthermore, when the 'supplement' mode is used, the term is now NOT
counted as (first) used (by default). This is now consistent with the
documentation.
2025-10-26 16:00:22 -06:00
swaits 4f26f9a194 docs(glossy): Add and modify first-use behaviour
Add a mode, two modifiers and change the default usage behaviour of some
modes. This documents the glossy 'API' when using terms with respect to
the usage counter.

Important!
At the moment, this is a description of the intended endresult
(documentation driven development). Next commits will bring the code in
accordance with this desired result.
2025-10-26 16:00:22 -06:00
swaits 2e9b81dff4 docs(glossy): Document modes vs modifiers
This distinction between 'mode' vs 'modifier' is already a bit visible
when looking at which modifiers can be combined and what output they
produce. This is just formalizing and categorizing that behaviour.

Also create a comprehensive reference table for all modes and modifiers.

This distinction is made in preparation for more modes & modifiers to
control the usage counter, while keeping everything understandable.
2025-10-26 16:00:22 -06:00
swaits 3b7a1404ea docs(glossy): Add format-term documentation 2025-10-26 16:00:22 -06:00
swaits b250c35f78 docs(glossy): Add Changelog to README 2025-10-26 16:00:22 -06:00
swaits 552858d813 Merge pull request #49 from chardetm/patch-1
Fixed term-links documentation in README.md
2025-10-26 16:00:21 -06:00
swaits 03e8e62c70 feat(glossy): Return array of pages in theme
Instead of returning an opaque context element with a fixed list of the
pages, return an array of context elements with each a page
(already unique!).
This is conceptually cleaner. Now it's the themes responsability to join
the array of unique pages however it wants. Most times, this will be a
`.join(", ")`, but could be e.g. `.first()` if the theme only wants to
show the page of the first occurance of this term.
Also update the documentation.

Breaking API change in the themes.
No visual differences (tests remain the same), but there are binary
differences.
2025-10-26 16:00:21 -06:00
swaits f7727f5abd Merge pull request #58 from jounathaen/patch-1
Corrected term-links word twister in README
2025-10-26 16:00:21 -06:00
swaits 68945132fb feat(glossy): Remove hide/hidden modifier
This modifier was not orthogonal with other modifiers (for example, it
could not be used together with :noindex)
Added documentation and modified test to reflect that @term[] with an
empty supplement has exactly the same result *and* is more orthogonal.

This partially reverts commit 5957432d5d.
2025-10-26 16:00:21 -06:00
swaits 93af7fa6b4 Merge pull request #50 from BurningKarl/fix-glossary-links
glossy: generate correct links to glossary entry
2025-10-26 16:00:21 -06:00
swaits 392e8a8122 fix(glossy): Ensure ∅ supplement results in ∅ content
Ensure an empty supplement results in glossy returning empty content,
instead of an empty string. Done by returning #none if no article is
wanted.

When the value #none is returned for the article, this can neatly join
with the other values without a trace. In particular, when `term` is
empty content, this ensures that only #metadata remains, exactly like
in the 'hidden' case.

Effectively, now @term[] is identical to @term:hidden, because no empty
string is inserted. This can be seen in the updated test case, where the
spaces around the blank term are now collapsed to a single space by
Typst, instead of keeping two spaces like before.

A next commit will remove :hidden, since it's not orthogonal w.r.t.
other modifiers, while using a supplement is.
2025-10-26 16:00:21 -06:00
swaits 3e0d7a9812 chore(glossy): Improve code readability
The new function was already present, but unused.
2025-10-26 16:00:21 -06:00
swaits 45112b434f chore(glossy): bump version to 0.8.0 2025-10-26 16:00:20 -06:00
swaits 8a2a2956bc chore: fix path in sync.sh script 2025-10-26 16:00:20 -06:00
swaits 68addf1204 Merge pull request #46 from BurningKarl/reduce-layout-attempts
Fix glossy: avoid duplicate key labels
2025-04-03 15:16:09 -07:00
swaits 8e8723b8d1 docs(glossy): update README with newest features 2025-04-03 15:06:46 -07:00
swaits 666f26586e Merge pull request #43 from playonverbs/feature/glossy/show-all
Add show-all flag to glossary() and test-case
2025-04-03 14:49:32 -07:00
swaits 3264971bfe Merge pull request #44 from kaerbr/main
docs: fix setting of custom theme in glossary function
2025-04-03 08:39:37 -07:00
swaits 4fc05c37a2 feat(glossy): use @term[supplement] to override term display
If you want to completely override how a term is displayed, you can pass
content in via the square brackets on the term's reference.

For example, a term @www which might normally display as "worldwide web
(WWW)" or something similar, could instead display as FOOBAR by using
@www[FOOBAR].
2025-04-03 08:37:28 -07:00
swaits 5957432d5d feat(glossy): adds hide/hidden modifier to suppress term display
There are cases where you might want a term referenced (ie from the
Glossary/Index), but don't want to display it. New modifiers
`hide`||`hidden` do exactly that.
2025-04-03 08:37:28 -07:00
swaits 966a89687a test(glossy): update all tests for Typst 0.13.0 2025-04-03 08:37:28 -07:00
swaits 2b8095d098 fix(glossy): default term-links to false
This parameter (to init-glossary()) enables/disables the terms in the
document linking to their place in the glossary. However, this adds a
crazy amount of extra queries which sometimes hinders Typst's ability to
converge on documents.
2025-04-03 08:37:28 -07:00
swaits c0077ca432 docs(glossy): fix theme parameter typos in README 2025-04-03 08:37:27 -07:00
swaits bc21afc193 chore: merge commit to consolidate upstream merges 2025-04-03 08:17:16 -07:00
swaits 193137fe9b test(codly-languages): update tests for next version 2025-03-04 14:46:32 -08:00
swaits f044759876 Merge pull request #41 from Akito3110/codly-languages-0.1.8
codly-languages: normalized and added lots of icons
2025-03-04 10:21:39 -08:00
swaits 1f5e01c136 chore: merge commit to consolidate upstream merges 2025-03-04 10:18:25 -08:00
swaits 7117a1e60f chore(glossy): update minimum compiler version to 0.13.0 2025-02-19 15:48:45 -07:00
swaits 9be60483a5 Merge pull request #33 from eltos/patch-1
Draft: [Glossy] Typst 0.13 compatibility
2025-02-19 15:42:20 -07:00
swaits 71b91b429c chore(codly-languages): bump version to 0.1.7
- Adds Agda language icon thanks to [@cyberglot](https://github.com/cyberglot), [PR30](https://github.com/swaits/typst-collection/pull/30)
2025-02-19 15:33:25 -07:00
swaits f9dc4de8d0 chore(codly-languages): update docs/test to point to codly:1.2.0 2025-02-19 15:24:53 -07:00
swaits 2f257b0b7a test(codly-languages): update test with Agda language change 2025-02-19 15:24:53 -07:00
swaits 3c7ecca2d0 Merge pull request #30 from cyberglot/main
feat(codly-languages): add Agda
2025-02-19 15:21:48 -07:00
swaits 8f3ef0d1d0 chore: merge bookmarkes which got merged upstream 2025-02-06 15:47:05 -07:00
swaits 28d0951b85 chore(finely-crafted-cv): add excludes, update Copyright in LICENSE 2025-01-26 13:22:28 -07:00
swaits ccd0e62ce2 chore(finely-crafte-cv): bump version to 0.3.0 2025-01-26 12:59:34 -07:00
swaits 081b821457 feat(finely-crafte-cv): make icon header user defineable 2025-01-26 12:56:09 -07:00
swaits 57c961dd18 test(finely-crafted-cv): copy the example into a test 2025-01-26 11:03:28 -07:00
swaits 4e4e93e096 chore(glossy): bump version to 0.6.0
Closes [#24](https://github.com/swaits/typst-collection/issues/24)

- Fixed academic theme (no longer hardcodes a font)
- New modifiers: noref/noindex - keeps terms out of glossary
- New behavior: short/long/both no longer count against "first use"
2025-01-25 16:10:14 -07:00
swaits 5b0bdf333f doc(glossy): update docs with new 0.6.0 features
- noref/noindex
- updated theme gallery (academic changed to not specify font)
- short/long/both no longer count against "first use"
2025-01-25 16:10:14 -07:00
swaits a903bf0fc8 feat(glossy): adds noref|noindex modifier
Per suggestion in [#24](https://github.com/swaits/typst-collection/issues/24)
2025-01-25 15:46:16 -07:00
swaits ee570f7487 fix(glossy): short/long/both usage no longer counts against a term's "first use"
Fixes [#24](https://github.com/swaits/typst-collection/issues/24)
2025-01-25 15:30:40 -07:00
swaits ef03fdfbc4 fix(glossy): remove font from academic theme 2025-01-25 12:30:32 -07:00
swaits 07c8fa50f9 chore(codly-languages): bump version to 0.1.6 2025-01-22 16:37:27 -07:00
swaits 8da80916df test(codly-languages): update test for splunk and nextflow 2025-01-22 16:02:26 -07:00
swaits 588eca1c7d Merge pull request #26 from SwiftSeal/nextflow
Add nextflow
2025-01-22 15:49:19 -07:00
swaits 7f3183bd92 Merge branch 'main' into nextflow 2025-01-22 15:48:21 -07:00
swaits 3e70585ffa Merge pull request #25 from philxws692/codly-languages-splunk
Added Splunk to codly-languages
2025-01-22 15:42:29 -07:00
swaits 7ad3c5ad65 chore(codly-languages): bump version to 0.1.5 2025-01-10 10:25:31 -07:00
swaits 079e80edb2 doc(codly-languages): update README
- clean up icon attribution section
- eliminate nauseating list of missing languages
2025-01-10 10:23:50 -07:00
swaits 4761b49867 chore(codly-languages): update LICENSE to 2025 copyright 2025-01-10 10:23:46 -07:00
swaits e4c1350ebc Merge pull request #23 from Kees-van-Beilen/patch-1
Update css3.svg
2025-01-10 09:37:52 -07:00
swaits d0e7fe4371 chore: add clean.sh to remove test artifacts 2025-01-10 09:21:44 -07:00
swaits 0cd345a123 merge: published easy-typography-0.1.0 and tasteful-pairings-0.1.0 to main 2025-01-10 08:47:52 -07:00
swaits d296f3a3f1 chore(tasteful-pairings): updated description from @neuralpain
Integrates change in [this
PR](https://github.com/typst/packages/pull/1526) from
[neuralpain](https://github.com/neuralpain).
2025-01-09 13:05:37 -07:00
swaits 338fee564f fix(tasteful-pairings): update Adobe open-source fonts to latest versions 2025-01-09 13:00:08 -07:00
swaits a2f2b6e59c merge: published versions codly-0.1.4, run-liners:0.1.0, and glossy-0.5.2 to main 2025-01-09 12:39:32 -07:00
swaits a76b261348 chore(easy-typography): rm rogue pdf 2025-01-09 12:17:26 -07:00
swaits 093fcf88fd fix(easy-typography): incorporates changes from community
Incoroporates changes from [this
PR](https://github.com/typst/packages/pull/1527) and updates tests
accordingly.

Thank you to [neuralpain](https://github.com/neuralpain) and
[ssotoen](https://github.com/ssotoen) for the suggestions and code
fixes.
2025-01-09 12:06:06 -07:00
swaits 9bb814f108 test(codly-languages): add test for cuda+cu 2025-01-08 17:26:17 -07:00
swaits 7ed699d2f7 chore(glossy): bumps version to 0.5.2 2025-01-07 22:54:43 -07:00
swaits 257926d7a5 chore(glossy): exclude bin dir in package manifest 2025-01-07 22:54:43 -07:00
swaits 647fddbf18 test(glossy): update test refs (minor layout diffs only) 2025-01-07 22:54:43 -07:00
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
swaits 40cc652aeb test(glossy): add bin/autotest.sh (uses watchexec) 2025-01-07 22:54:43 -07:00
swaits 600925157a fix(codly-languages): replace awk/groovy icons with smaller file sized icons 2025-01-07 22:54:20 -07:00
swaits ed552faef2 chore(codly-languages): bump version to 0.1.4 2025-01-07 22:54:19 -07:00
swaits 5964bc082a feat(codly-languages): add Lisp
Closes [#20](https://github.com/swaits/typst-collection/issues/20).
2025-01-07 22:54:19 -07:00
swaits 41e1c184e8 chore(codly-language): change to codly:1.1.1 2025-01-07 22:54:19 -07:00
swaits 1e095a8b26 feat(tasteful-pairings): initial version 2025-01-07 22:52:47 -07:00
swaits 5d8eb4763e feat(run-liners): initial implementation 2025-01-07 22:52:47 -07:00
swaits 5ad6c10b65 feat(easy-typography): initial implementation 2025-01-07 22:52:47 -07:00
swaits 05a66f4956 test(glossy): repair utf-handling test 2024-12-22 13:40:13 -07:00
swaits df889d8d72 feat(glossy): add sort: true parameter to glossary() 2024-12-21 22:27:07 -07:00
swaits c008b5bd86 feat(glossy): release 0.5.1 2024-12-20 12:48:19 -07:00
swaits 842166c211 fix(glossy): use codepoints (not bytes!) in article code
Fixes [#18](https://github.com/swaits/typst-collection/issues/18)
2024-12-20 12:37:21 -07:00
swaits c37c6750c6 feat(glossy): release 0.5.0
New feature:

`init-glossary()` now accepts a `format-term()` function which gives the
user control over how the short-form and long-form of the terms are
assembled based on the needed mode ("short", "long", or "both").

Change:

Default theme changed to `theme-academic`, which is probably more
generally useful than the prior (`theme-twocol`).
2024-12-20 11:28:32 -07:00
swaits 03d82458bb feat(glossy): change default theme to theme-academic 2024-12-20 11:28:32 -07:00
swaits 725f657f49 feat(glossy): adds format-term customizability
Idea [from Discord
conversation](https://discord.com/channels/1054443721975922748/1318670789150642246/1319338465757757562).

Let's users more precisely control how short-form and long-form terms
are used based on the mode ("short", "long", or "both").

Defaults to `__default-format-term()` as below:

```typst
// Formats a term string based on the specified mode.
//
// Given mode, long-form, and short-form, this function returns the formatted
// term based on the mode. When mode is ...
//
// - "short" -> returns "short-form"
// - "long" -> returns "long-form"
// - "both" -> returns "short-form (long-form)"
//
// Parameters:
//   mode (string): The mode in which to format the term. Possible values are "short", "long", or "both".
//   short-form (string): The short form of the term.
//   long-form (string): The long form of the term.
//
// Returns:
//   string: The formatted term based on the specified mode.
//
#let __default-format-term(mode, short-form, long-form) = {
    if mode == "short" {
      short-form
    } else if mode == "long" {
      long-form
    } else {
      // mode assumed to be "both"
      long-form + " (" + short-form + ")"
    }
}
```
2024-12-20 11:28:32 -07:00
swaits cf139b66f6 chore(glossy): rm trailing whitespace 2024-12-20 11:28:31 -07:00
swaits 461439d2f9 chore: update .build.yml (missing cd into repo dir) 2024-12-19 10:54:12 -07:00
swaits 607814713a chore: update .build.yml (change $HOME for ~) 2024-12-19 10:52:13 -07:00
swaits 4d94a3f7f2 chore: update .build.yml (remove duplicate clone) 2024-12-19 10:48:11 -07:00
swaits bc011bfa6b chore: update .build.yml 2024-12-19 10:44:36 -07:00
swaits 1e1cb91163 feat(glossy): terms now link to glossary entries
- 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!
2024-12-19 09:36:49 -07:00
swaits 2286037bd6 chore(glossy): release version 0.4.0
## 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)
2024-12-18 10:15:20 -07:00