Compare commits

..
Author SHA1 Message Date
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
Philipp Niedermayer 255bda30d4 Typo 2024-12-18 20:21:27 +00:00
Philipp Niedermayer 2b6debb7d1 Make terms clickable links to glossary list 2024-12-18 20:07:01 +00:00
Philipp Niedermayer 80eeb9240c Fix intendation 2024-12-18 20:07:01 +00:00
Philipp Niedermayer 76fb6b9ea7 Simplifies term usage tracking
- 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".
2024-12-18 20:06:53 +00:00
Philipp Niedermayer 16ceebdc70 Simply label usage
- 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
2024-12-18 20:06:53 +00: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
swaits a8e0ef7c02 test(glossy): add test to exhaust all reference options 2024-12-18 10:14:18 -07:00
swaits 3dce3d1734 feat(glossy): add support for articles through modifiers 2024-12-18 06:39:43 -07:00
swaits ba8fdda1bf feat(glossy): improve pluralize 2024-12-18 06:08:52 -07:00
swaits e14331cfc0 feat(glossy): add utility for determining indefinite articles in English 2024-12-18 06:08:51 -07:00
swaits b1aa11705c chore(glossy): cleanup rogue PDF 2024-12-18 06:08:51 -07:00
swaits 64fbdce1d2 fix(rfc-vibe): thumbnail update 2024-12-18 06:05:11 -07:00
swaits 62741c691c doc(README): typo fix 2024-12-17 21:42:51 -07:00
swaits f018aebc7b fix(rfc-vibe): typo - thank you theRealProHacker
Merge pull request #15 from theRealProHacker/patch-1

Typo in /tests/basic-output/test.typ
2024-12-17 12:46:36 -07:00
theRealProHacker bc06eeaaf9 Typo in /tests/basic-output/test.typ 2024-12-17 12:46:36 -07:00
swaits 95b21505cb doc(glossy): cleanup some stale TODOs 2024-12-17 12:46:36 -07:00
swaits 5eee23a59e chore(glossy): bump version to 0.3.0 2024-12-16 18:30:53 -07:00
swaits 0a87404a18 feat(glossy): add type-checking
- adds type-checking via the valkyrie package
- fixes handling of groups parameter on #glossary()
- new test for relevant changes
2024-12-16 18:30:09 -07:00
swaits d2e44f4131 doc(glossy): update docs on concise syntax 2024-12-16 17:46:09 -07:00
swaits 7f1d1d711a test(glossy): add tests for concise syntax 2024-12-16 17:45:40 -07:00
Philipp Niedermayer 91de1816e9 Allow concise entry definition
closes #13
2024-12-15 19:32:27 +00:00
swaits f4b7cc1374 chore: recreate sync.sh for new dir scheme 2024-12-11 00:24:46 +00:00
swaits 9645626ee5 chore: try (again) to make github mirroring include all branches 2024-12-10 22:46:36 +00:00
swaits 4fdd6e2ccd chore: try to make github mirroring include all branches 2024-12-10 22:41:52 +00:00
swaits 7c9ab5f046 chore: rm sync.sh, not applicable any more 2024-12-10 22:25:28 +00:00
swaits a2a9ad0eed doc(README): add swank-tex to the package directory 2024-12-10 22:23:41 +00:00
swaits 274e9bad2f chore: remove preview/ directory 2024-12-10 22:21:15 +00:00
swaits 78c5b8a000 chore: bring all branches back together 2024-12-10 22:19:46 +00:00
swaits 53c0206a03 feat(swank-tex): 0.1.0 2024-12-10 22:09:57 +00:00
swaits 3107573ef2 feat(rfc-vibe): 0.1.0 2024-12-10 22:09:15 +00:00
swaits 6ea69a0ddb feat(pro-letter): 0.1.1 2024-12-10 22:07:36 +00:00
swaits 6231fe43fb feat(pro-letter): 0.1.0 2024-12-10 21:59:22 +00:00
swaits 155568c435 feat(finely-crafted-cv): 0.1.0 2024-12-10 21:56:46 +00:00
swaits 248c520952 feat(codely-languages): 0.1.3 2024-12-10 21:54:54 +00:00
swaits adf2ea5021 feat(codely-languages): 0.1.2 2024-12-10 21:54:25 +00:00
swaits bae9716298 feat(codely-languages): 0.1.1 2024-12-10 21:54:04 +00:00
swaits 21a9a2aac8 feat(codely-languages): 0.1.0 2024-12-10 21:53:05 +00:00
swaits 86f16a7ac0 feat(glossy): 0.2.2 2024-12-10 20:45:18 +00:00
475 changed files with 2510 additions and 2649 deletions

No files matched your search

+21 -5
View File
@@ -1,11 +1,27 @@
image: alpine/edge
packages:
- git
secrets:
- 88cce185-d2ec-4573-9546-e33f36f79bbf
sources:
- git+ssh://git@git.sr.ht/~swaits/typst-collection
environment:
# repo and user names on both sr.ht and github
REPO: typst-collection
USER: swaits
tasks:
- fetch-all-branches: |
cd "$HOME/$REPO"
git fetch origin '+refs/heads/*:refs/heads/*' '+refs/tags/*:refs/tags/*' --prune
- get-github-public-key: |
ssh-keyscan -t rsa github.com >> "$HOME/.ssh/known_hosts"
- add-github-remote: |
cd "$HOME/$REPO"
git remote add github "git@github.com:$USER/$REPO.git"
- mirror-to-github: |
cd ~/typst-collection
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
git remote add github git@github.com:swaits/typst-collection.git
cd "$HOME/$REPO"
git push --mirror github
+3 -1
View File
@@ -2,7 +2,7 @@
A collection of `typst` templates and packages by [swaits](https://swaits.com/about).
Everything in this collections is available for use at the [`typst`
Everything in this collection is available for use at the [`typst`
universe](https://typst.app/universe/). For details on each, please visit the
links below to their main page.
@@ -15,6 +15,8 @@ links below to their main page.
glossary system with easily customizable output.
- [**rfc-vibe**](https://typst.app/universe/package/rfc-vibe): Bring RFC language
into everyday docs.
- [**swank-tex**](https://typst.app/universe/package/swank-tex): Render those
funky logos for TeX, LaTeX, and friends.
## Templates
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 475 files, more files were not shown because too many files have changed in this diff. Show more