Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b399080660
|
No files matched your search
@@ -1,6 +0,0 @@
|
|||||||
STOP! This repository is being migrated.
|
|
||||||
|
|
||||||
All packages have moved to:
|
|
||||||
https://github.com/swaits-typst-packages
|
|
||||||
|
|
||||||
Do NOT create new issues or PRs here.
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
image: alpine/edge
|
||||||
|
packages:
|
||||||
|
- git
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
- 88cce185-d2ec-4573-9546-e33f36f79bbf
|
||||||
|
|
||||||
|
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 "$HOME/$REPO"
|
||||||
|
git push --mirror github
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
Migration started: 2025-10-26 21:22
|
|
||||||
|
|
||||||
This repository is being split into individual package repositories.
|
|
||||||
During this transition:
|
|
||||||
- No new issues or PRs should be created
|
|
||||||
- Existing issues are being triaged and moved
|
|
||||||
- The repository will be archived once migration is complete
|
|
||||||
|
|
||||||
New organization: https://github.com/swaits-typst-packages
|
|
||||||
@@ -1,54 +1,3 @@
|
|||||||
# 🚨 REPOSITORY MOVING - DO NOT CREATE NEW ISSUES OR PRS HERE 🚨
|
|
||||||
|
|
||||||
<div align="center">
|
|
||||||
|
|
||||||
## ⛔ THIS REPOSITORY IS BEING MIGRATED ⛔
|
|
||||||
|
|
||||||
### **ALL PACKAGES ARE MOVING TO:** [github.com/swaits-typst-packages](https://github.com/swaits-typst-packages)
|
|
||||||
|
|
||||||
**DO NOT:**
|
|
||||||
- ❌ Create new issues here
|
|
||||||
- ❌ Submit new pull requests here
|
|
||||||
- ❌ Start new work based on this repo
|
|
||||||
|
|
||||||
**INSTEAD:**
|
|
||||||
- ✅ Go to the new organization: [swaits-typst-packages](https://github.com/swaits-typst-packages)
|
|
||||||
- ✅ Find your specific package repository there
|
|
||||||
- ✅ Create issues/PRs in the individual package repos
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 📦 New Repository Locations
|
|
||||||
|
|
||||||
| If you're looking for... | Go to... |
|
|
||||||
|--------------------------|----------|
|
|
||||||
| **codly-languages** | ➡️ [github.com/swaits-typst-packages/codly-languages](https://github.com/swaits-typst-packages/codly-languages) |
|
|
||||||
| **easy-typography** | ➡️ [github.com/swaits-typst-packages/easy-typography](https://github.com/swaits-typst-packages/easy-typography) |
|
|
||||||
| **finely-crafted-cv** | ➡️ [github.com/swaits-typst-packages/finely-crafted-cv](https://github.com/swaits-typst-packages/finely-crafted-cv) |
|
|
||||||
| **glossy** | ➡️ [github.com/swaits-typst-packages/glossy](https://github.com/swaits-typst-packages/glossy) |
|
|
||||||
| **pro-letter** | ➡️ [github.com/swaits-typst-packages/pro-letter](https://github.com/swaits-typst-packages/pro-letter) |
|
|
||||||
| **rfc-vibe** | ➡️ [github.com/swaits-typst-packages/rfc-vibe](https://github.com/swaits-typst-packages/rfc-vibe) |
|
|
||||||
| **run-liners** | ➡️ [github.com/swaits-typst-packages/run-liners](https://github.com/swaits-typst-packages/run-liners) |
|
|
||||||
| **swank-tex** | ➡️ [github.com/swaits-typst-packages/swank-tex](https://github.com/swaits-typst-packages/swank-tex) |
|
|
||||||
| **tasteful-pairings** | ➡️ [github.com/swaits-typst-packages/tasteful-pairings](https://github.com/swaits-typst-packages/tasteful-pairings) |
|
|
||||||
|
|
||||||
## ⏳ Migration In Progress
|
|
||||||
|
|
||||||
We are currently:
|
|
||||||
1. Moving existing issues to the appropriate new repositories
|
|
||||||
2. Redirecting pull requests to the new locations
|
|
||||||
3. Setting up the new package infrastructure
|
|
||||||
|
|
||||||
**Expected completion: [Coming Soon]**
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>📜 Original README (click to expand)</summary>
|
|
||||||
|
|
||||||
# `typst-collection`
|
# `typst-collection`
|
||||||
|
|
||||||
A collection of `typst` templates and packages by [swaits](https://swaits.com/about).
|
A collection of `typst` templates and packages by [swaits](https://swaits.com/about).
|
||||||
@@ -86,5 +35,3 @@ links below to their main page.
|
|||||||
## License
|
## License
|
||||||
|
|
||||||
All content licensed under the [MIT license](LICENSE).
|
All content licensed under the [MIT license](LICENSE).
|
||||||
|
|
||||||
</details>
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
# `typst-collection`
|
|
||||||
|
|
||||||
A collection of `typst` templates and packages by [swaits](https://swaits.com/about).
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
## Packages
|
|
||||||
|
|
||||||
- [**codly-languages**](https://typst.app/universe/package/codly-languages): A
|
|
||||||
set of language configurations for use with
|
|
||||||
[codly](https://typst.app/universe/package/codly).
|
|
||||||
- [easy-typography](https://typst.app/universe/package/easy-typography): Sets up
|
|
||||||
sensible typography defaults.
|
|
||||||
- [**glossy**](https://typst.app/universe/package/glossy): A very simple
|
|
||||||
glossary system with easily customizable output.
|
|
||||||
- [**rfc-vibe**](https://typst.app/universe/package/rfc-vibe): Bring RFC language
|
|
||||||
into everyday docs.
|
|
||||||
- [**run-liners**](https://typst.app/universe/package/run-liners): Functions to
|
|
||||||
create various run-in lists.
|
|
||||||
- [**swank-tex**](https://typst.app/universe/package/swank-tex): Render those
|
|
||||||
funky logos for TeX, LaTeX, and friends.
|
|
||||||
- [**tasteful-pairings**](https://typst.app/universe/package/tasteful-pairings):
|
|
||||||
A carefully curated collection of font pairings focusing on readability and
|
|
||||||
typographic harmony.
|
|
||||||
|
|
||||||
## Templates
|
|
||||||
|
|
||||||
- [**finely-crafted-cv**](https://typst.app/universe/package/finely-crafted-cv):
|
|
||||||
A modern résumé/curriculum vitæ template with high attention to detail.
|
|
||||||
- [**pro-letter**](https://typst.app/universe/package/pro-letter): A formal
|
|
||||||
business letter template.
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
All content licensed under the [MIT license](LICENSE).
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
SRC_REPO_ROOT="$(pwd)"
|
|
||||||
DEST_PARENT="../swaits-typst-collection" # change if you like
|
|
||||||
|
|
||||||
DIRS=(
|
|
||||||
codly-languages
|
|
||||||
)
|
|
||||||
|
|
||||||
command -v git-filter-repo >/dev/null || {
|
|
||||||
echo "git-filter-repo is required. Install via 'uv tool install git-filter-repo' (or pipx/pip)."
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
mkdir -p "$DEST_PARENT"
|
|
||||||
|
|
||||||
for d in "${DIRS[@]}"; do
|
|
||||||
[ -d "$d" ] || {
|
|
||||||
echo "Skip: '$d' not found in $(pwd)"
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
TARGET="$DEST_PARENT/$d"
|
|
||||||
echo
|
|
||||||
echo "==> Splitting '$d' → '$TARGET'"
|
|
||||||
|
|
||||||
rm -rf "$TARGET"
|
|
||||||
git clone --no-local --branch main --origin origin "$SRC_REPO_ROOT" "$TARGET"
|
|
||||||
|
|
||||||
(
|
|
||||||
cd "$TARGET"
|
|
||||||
|
|
||||||
git filter-repo --force \
|
|
||||||
--path "$d/" \
|
|
||||||
--path-rename "$d/:"
|
|
||||||
|
|
||||||
# ---- Tag rename: '<dir>-X.Y.Z' -> 'vX.Y.Z' (annotated, with message) ----
|
|
||||||
# Peel old tags to the commit/object they point to to avoid nested tags.
|
|
||||||
while IFS= read -r oldtag; do
|
|
||||||
# only proceed if the (filtered) repo still has this tag
|
|
||||||
git rev-parse -q --verify "refs/tags/$oldtag" >/dev/null || continue
|
|
||||||
|
|
||||||
peeled=$(git rev-parse -q --verify "${oldtag}^{}" || true)
|
|
||||||
[ -z "$peeled" ] && continue
|
|
||||||
|
|
||||||
ver="${oldtag#${d}-}"
|
|
||||||
newtag="v${ver}"
|
|
||||||
|
|
||||||
if git rev-parse -q --verify "refs/tags/$newtag" >/dev/null; then
|
|
||||||
echo "Tag exists, deleting old: $oldtag"
|
|
||||||
git tag -d "$oldtag" >/dev/null
|
|
||||||
else
|
|
||||||
# annotated tag with message equal to tag name (avoids interactive prompt)
|
|
||||||
git -c advice.nestedTag=false tag -a "$newtag" -m "$newtag" "$peeled"
|
|
||||||
git tag -d "$oldtag" >/dev/null
|
|
||||||
echo "Renamed: $oldtag -> $newtag (at $peeled)"
|
|
||||||
fi
|
|
||||||
done < <(git tag -l "${d}-*")
|
|
||||||
|
|
||||||
# standalone: drop the monorepo remote that filter-repo rewired
|
|
||||||
git remote remove origin || true
|
|
||||||
|
|
||||||
echo "Done: $TARGET"
|
|
||||||
)
|
|
||||||
done
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo "All splits complete under: $DEST_PARENT"
|
|
||||||
@@ -10,10 +10,10 @@ Pretty simple. Import `codly`. Initialize it. Import `codly-languages`.
|
|||||||
Configure `codly` with the languages. Like this:
|
Configure `codly` with the languages. Like this:
|
||||||
|
|
||||||
```typst
|
```typst
|
||||||
#import "@preview/codly:1.3.0": *
|
#import "@preview/codly:1.2.0": *
|
||||||
#show: codly-init
|
#show: codly-init
|
||||||
|
|
||||||
#import "@preview/codly-languages:0.1.10": *
|
#import "@preview/codly-languages:0.1.8": *
|
||||||
#codly(languages: codly-languages)
|
#codly(languages: codly-languages)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -4,20 +4,21 @@
|
|||||||
// To use:
|
// To use:
|
||||||
//
|
//
|
||||||
// ```typst
|
// ```typst
|
||||||
// #import "@preview/codly:1.3.0": *
|
// #import "@preview/codly:1.2.0": *
|
||||||
// #show: codly-init
|
// #show: codly-init
|
||||||
//
|
//
|
||||||
// #import "codly-languages.typ:0.1.10": *
|
// #import "codly-languages.typ:0.1.8": *
|
||||||
// #codly(languages: codly-languages)
|
// #codly(languages: codly-languages)
|
||||||
// ```
|
// ```
|
||||||
#let codly-languages = {
|
#let codly-languages = {
|
||||||
// helper function which takes an image filename and creates an icon
|
// helper function which takes an image filename and creates an icon
|
||||||
let __icon(image-filename) = {
|
let __icon(image-filename) = {
|
||||||
box(
|
box(
|
||||||
image("icons/" + image-filename, height: 130%, fit: "contain"),
|
image("icons/" + image-filename, height: 0.9em),
|
||||||
|
baseline: 0.05em,
|
||||||
inset: 0pt,
|
inset: 0pt,
|
||||||
outset: 0pt,
|
outset: 0pt,
|
||||||
)
|
) + h(0.3em)
|
||||||
}
|
}
|
||||||
|
|
||||||
let __emoji(emoji) = {
|
let __emoji(emoji) = {
|
||||||
@@ -25,7 +26,7 @@
|
|||||||
emoji,
|
emoji,
|
||||||
inset: 0pt,
|
inset: 0pt,
|
||||||
outset: 0pt,
|
outset: 0pt,
|
||||||
)
|
) + h(0.3em)
|
||||||
}
|
}
|
||||||
|
|
||||||
// configurations for languages
|
// configurations for languages
|
||||||
@@ -642,9 +643,9 @@
|
|||||||
tsx: (name: "TSX", color: rgb("#007acc"), icon: __icon("typescript.svg")), //Devicons
|
tsx: (name: "TSX", color: rgb("#007acc"), icon: __icon("typescript.svg")), //Devicons
|
||||||
typescriptreact: (name: "React", color: rgb("#61dafb"), icon: __icon("react.svg")), //Devicons
|
typescriptreact: (name: "React", color: rgb("#61dafb"), icon: __icon("react.svg")), //Devicons
|
||||||
//Typst
|
//Typst
|
||||||
typst: (name: "Typst", color: rgb("#458fa0"), icon: __icon("typst.svg")), //Typst
|
typst: (name: "Typst", color: rgb("#8b70c3"), icon: __icon("typst.svg")), //Typst
|
||||||
typ: (name: "Typst", color: rgb("#458fa0"), icon: __icon("typst.svg")), //Typst
|
typ: (name: "Typst", color: rgb("#458fa0"), icon: __icon("typst.svg")), //Typst
|
||||||
typc: (name: "Typst", color: rgb("#458fa0"), icon: __icon("typst.svg")), //Typst
|
typc: (name: "Typst", color: rgb("#8b70c3"), icon: __icon("typst.svg")), //Typst
|
||||||
typm: (name: "Typst", color: rgb("#458fa0"), icon: __icon("typst.svg")), //Typst
|
typm: (name: "Typst", color: rgb("#458fa0"), icon: __icon("typst.svg")), //Typst
|
||||||
//UML
|
//UML
|
||||||
uml: (name: "UML", color: rgb("#452e7f"), icon: __icon("unifiedmodelinglanguage.svg")), //Devicons
|
uml: (name: "UML", color: rgb("#452e7f"), icon: __icon("unifiedmodelinglanguage.svg")), //Devicons
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 97 KiB |
|
Before Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 92 KiB |
|
Before Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 72 KiB |
@@ -1,4 +1,4 @@
|
|||||||
#import "@preview/codly:1.3.0": *
|
#import "@preview/codly:1.2.0": *
|
||||||
#import "/lib.typ": *
|
#import "/lib.typ": *
|
||||||
#show: codly-init
|
#show: codly-init
|
||||||
#codly(languages: codly-languages)
|
#codly(languages: codly-languages)
|
||||||
|
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 254 KiB |
@@ -1,5 +1,5 @@
|
|||||||
#import "/lib.typ": *
|
#import "/lib.typ": *
|
||||||
#import "@preview/codly:1.3.0": *
|
#import "@preview/codly:1.2.0": *
|
||||||
#show: codly-init
|
#show: codly-init
|
||||||
#codly(languages: codly-languages)
|
#codly(languages: codly-languages)
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "codly-languages"
|
name = "codly-languages"
|
||||||
version = "0.1.10"
|
version = "0.1.8"
|
||||||
entrypoint = "lib.typ"
|
entrypoint = "lib.typ"
|
||||||
authors = ["Stephen Waits <steve@waits.net>"]
|
authors = ["Stephen Waits <steve@waits.net>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
description = "A set of language configurations for use with codly"
|
description = "A set of language configurations for use with codly"
|
||||||
keywords = ["code", "languages", "template", "raw"]
|
keywords = ["code", "languages", "template", "raw"]
|
||||||
repository = "https://git.swaits.com/swaits/typst-collection"
|
repository = "https://github.com/swaits/typst-collection"
|
||||||
exclude = ["thumbnail.png", "tests"]
|
exclude = ["thumbnail.png", "tests"]
|
||||||
@@ -6,5 +6,5 @@ authors = ["Stephen Waits <steve@waits.net>"]
|
|||||||
license = "MIT"
|
license = "MIT"
|
||||||
description = "Sets up sensible typography defaults."
|
description = "Sets up sensible typography defaults."
|
||||||
keywords = ["easy", "typography", "defaults"]
|
keywords = ["easy", "typography", "defaults"]
|
||||||
repository = "https://git.swaits.com/swaits/typst-collection"
|
repository = "https://github.com/swaits/typst-collection"
|
||||||
exclude = ["thumbnail.png", "tests"]
|
exclude = ["thumbnail.png", "tests"]
|
||||||
@@ -12,7 +12,6 @@
|
|||||||
body-size: BODY_SIZE,
|
body-size: BODY_SIZE,
|
||||||
icon-contact-header: none,
|
icon-contact-header: none,
|
||||||
keywords: "",
|
keywords: "",
|
||||||
show_last_updated: true,
|
|
||||||
thumbnail: none, // check out https://qrframe.kylezhe.ng/ for QR code generation
|
thumbnail: none, // check out https://qrframe.kylezhe.ng/ for QR code generation
|
||||||
body
|
body
|
||||||
) = {
|
) = {
|
||||||
@@ -48,7 +47,7 @@
|
|||||||
columns: (1fr, 1fr, 1fr),
|
columns: (1fr, 1fr, 1fr),
|
||||||
align: (left, center, right + horizon),
|
align: (left, center, right + horizon),
|
||||||
// left column
|
// left column
|
||||||
if show_last_updated [Last updated: #date],
|
[Last updated: #date],
|
||||||
// center column
|
// center column
|
||||||
if multi_page { counter(page).display(both: true, "1 of 1") },
|
if multi_page { counter(page).display(both: true, "1 of 1") },
|
||||||
// right column
|
// right column
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ description = "A modern résumé/curriculum vitæ template with high attention t
|
|||||||
categories = ["cv"]
|
categories = ["cv"]
|
||||||
disciplines = ["business", "communication"]
|
disciplines = ["business", "communication"]
|
||||||
keywords = ["resume", "curriculum", "vitae", "cv"]
|
keywords = ["resume", "curriculum", "vitae", "cv"]
|
||||||
repository = "https://git.swaits.com/swaits/typst-collection"
|
repository = "https://github.com/swaits/typst-collection"
|
||||||
exclude = ["thumbnail.png", "tests"]
|
exclude = ["thumbnail.png", "tests"]
|
||||||
|
|
||||||
[template]
|
[template]
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
build/
|
|
||||||
tests/**/diff/
|
|
||||||
tests/**/out/
|
tests/**/out/
|
||||||
|
tests/**/diff/
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2025 Stephen Waits <steve@waits.net>
|
Copyright (c) 2024 Stephen Waits <steve@waits.net>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ different goals:
|
|||||||
### Import the package
|
### Import the package
|
||||||
|
|
||||||
```typst
|
```typst
|
||||||
#import "@preview/glossy:0.9.0": *
|
#import "@preview/glossy:0.8.0": *
|
||||||
```
|
```
|
||||||
|
|
||||||
### Defining Glossary Terms
|
### Defining Glossary Terms
|
||||||
@@ -128,10 +128,9 @@ And then loaded during initialization as follows:
|
|||||||
|
|
||||||
`init-glossary()` supports the following parameters:
|
`init-glossary()` supports the following parameters:
|
||||||
|
|
||||||
- `format-term` // Function deciding how to format a term, depending on
|
- `format-term` // TODO: document this
|
||||||
the 'mode' (short, long, both). See example below.
|
|
||||||
- `show-term` // Function which can customize display of a term (see example below)
|
- `show-term` // Function which can customize display of a term (see example below)
|
||||||
- `term-links: false` // True if you want terms to link to their glossary entry
|
- `link-terms: false` // True if you want terms to link to their glossary entry
|
||||||
|
|
||||||
### Using Glossary Terms
|
### Using Glossary Terms
|
||||||
|
|
||||||
@@ -142,27 +141,19 @@ In modern web development, languages like @html and @css are essential.
|
|||||||
The @tps:pl need to be submitted by Friday.
|
The @tps:pl need to be submitted by Friday.
|
||||||
```
|
```
|
||||||
|
|
||||||
Available *modes* (they determine which information is printed and are
|
Available modifiers:
|
||||||
mutually exclusive):
|
|
||||||
|
|
||||||
- auto: (Default) Shows the form depending on the previous usage.
|
- **cap**: Capitalizes the term
|
||||||
The mode when no other mode is appended with a colon.
|
- **pl**: Uses the plural form
|
||||||
- **both**: Shows "Long Form (Short Form)"
|
- **both**: Shows "Long Form (Short Form)"
|
||||||
- **short**: Shows only short form
|
- **short**: Shows only short form
|
||||||
- **long**: Shows only long form
|
- **long**: Shows only long form
|
||||||
- **def** or **desc**: Shows the description
|
- **def** or **desc**: Shows the description
|
||||||
- See [the reference](#reference-for-using-glossary-terms)
|
|
||||||
for a complete overview.
|
|
||||||
|
|
||||||
Available *modifiers* (they modify how this information is printed):
|
|
||||||
|
|
||||||
- **cap**: Capitalizes the term
|
|
||||||
- **pl**: Uses the plural form
|
|
||||||
- **noref** or **noindex**: Don't show the term in the glossary.
|
- **noref** or **noindex**: Don't show the term in the glossary.
|
||||||
- **a** or **an**: Include the article (`an` is just an alias of `a`, they're
|
- **a** or **an**: Include the article (`an` is just an alias of `a`, they're
|
||||||
equivalent)
|
equivalent)
|
||||||
|
|
||||||
Modes and modifiers can be combined with colons:
|
Modifiers can be combined with colons:
|
||||||
|
|
||||||
| **Input** | **Output** |
|
| **Input** | **Output** |
|
||||||
| ------------------- | -------------------------------------------------------------- |
|
| ------------------- | -------------------------------------------------------------- |
|
||||||
@@ -207,71 +198,21 @@ which would normally render as something like "test procedure specification."
|
|||||||
But for some reason you want it to actually say "an annoying report." You can do
|
But for some reason you want it to actually say "an annoying report." You can do
|
||||||
that like this:
|
that like this:
|
||||||
|
|
||||||
| **Input** | **Output** |
|
| **Input** | **Output** |
|
||||||
| -------------------------- | -------------------- |
|
| ------------------------- | -------------------- |
|
||||||
| `@tps[an annoying report]` | "an annoying report" |
|
| `@tps[an annoying report` | "an annoying report" |
|
||||||
| `@tps[]` | #none |
|
|
||||||
|
|
||||||
In case you want to reference a term from the Glossary/Index, but don't
|
|
||||||
want to display it for whatever reason, the second form can be used.
|
|
||||||
|
|
||||||
### First use logic
|
### First use logic
|
||||||
|
|
||||||
The 'mode' of a glossary term determines which information is printed about this
|
Any use of the `short`, `long`, or `both` modifier will not count against the
|
||||||
term. When using a plain `@term`, possibly with some modifiers, the `auto` mode
|
term's first use.
|
||||||
is selected. This mode displays the form depending on the usage counter. On the
|
|
||||||
first use (`usage counter == 0`), 'both' forms are printed. On subsequent usage
|
|
||||||
(`usage counter > 0`) the 'short' form is printed.
|
|
||||||
|
|
||||||
Not all occurrences of a term are counted towards its usage, this depends on
|
This is useful, for example, when you want to use a term in a heading or a
|
||||||
the mode of the term. Furthermore, this can be manually controlled by modifiers.
|
caption. In that case, your term might end up in an `outline()` at the top of
|
||||||
Both are documented in the [reference tables](#reference-for-using-glossary-terms).
|
|
||||||
|
|
||||||
This control over the usage counter is practical, for example, when you want to
|
|
||||||
use a term in a heading or a caption.
|
|
||||||
In that case, your term might end up in an `outline()` at the top of
|
|
||||||
your document. Normally you don't want that to count as a term's first real use.
|
your document. Normally you don't want that to count as a term's first real use.
|
||||||
Normally you want that to happen in the body of your document. So, by using
|
Normally you want that to happen in the body of your document. So, by using
|
||||||
the appropriate mode and modifiers in such situations, you can not only specify
|
these modifiers in such situations, you can not only specify exactly how you
|
||||||
exactly how you want your term to appear, but also control whether it counts
|
want your term to appear, but also control whether it counts as a "first use".
|
||||||
as a "first use".
|
|
||||||
|
|
||||||
### Reference for Using Glossary Terms
|
|
||||||
|
|
||||||
A reference about
|
|
||||||
- the different 'modes' and how they determine which information is printed about a term
|
|
||||||
- the impact of modes on the [usage counter and ensuing first use behaviour](#first-use-logic)
|
|
||||||
- how modifiers can change the behaviour with respect to the usage counter
|
|
||||||
- how modifiers impact the presentation of the information printed
|
|
||||||
|
|
||||||
A glossary term can display different types of information, which is determined
|
|
||||||
by the 'mode' in which it is printed. These modes are all mutually exclusive.
|
|
||||||
|
|
||||||
| Mode | Utilization | Default first use behaviour | Description |
|
|
||||||
| ------------- | ------------------- | --------------------------- | ----------- |
|
|
||||||
| `auto` | `@term` | use | The default mode when no 'mode' modifier or supplement is specified. The form depends on the first use counter. |
|
|
||||||
| `both` | `:both` | use | Shows both forms of the term, by default ([see `format-term`](#customizing-term-display)) like "Long Form (Short Form)". Falls back to short when long form not available. |
|
|
||||||
| `short` | `:short` | no-use | Shows only short form. |
|
|
||||||
| `long` | `:long` | no-use | Shows only long form. Falls back to short when long form not available. |
|
|
||||||
| `description` | `:def` <br> `:desc` | no-use | Shows the description (None of the modifiers apply here & no link is created towards the glossary). |
|
|
||||||
| `supplement` | `[content]` | no-use | Shows the content given by [the supplement](#overriding-term-text). |
|
|
||||||
| `reset` | `:reset` | reset usage counter to 0 | Don't output any content & don't link to the glossary. Typical usage would be after an abstract or even before the start of each chapter, maybe in an injected rule. (This could be made a modifier like `:use` or `:nouse`, but would mostly be utilized as `@term:reset:noindex[]` anyways, thus this is a mode. Write `@term@term:reset` to utilize it as a modifier.) |
|
|
||||||
|
|
||||||
Minor modifications to how these different types of information are printed,
|
|
||||||
linked or counted towards the usage counter, are controlled by the 'modifiers'.
|
|
||||||
They do not influence the default first use behaviour of the mode (unless
|
|
||||||
explicitely created for this purpose). Moreover, they neatly compose together
|
|
||||||
and with most modes (some exceptions exists, but will print a clear error -
|
|
||||||
report a bug if not).
|
|
||||||
|
|
||||||
| Modifier | Description |
|
|
||||||
| ------------------------------ | ---------------------------------------------------------------------- |
|
|
||||||
| `:cap` | Capitalizes the term |
|
|
||||||
| `:pl` | Uses the plural form |
|
|
||||||
| `:noref` <br> `:noindex` | Don't show the term in the glossary (i.e. no page will be linked - a link from the term towards the glossary is always provided.). |
|
|
||||||
| `:a`<br>`a:`<br>`:an`<br>`an:` | Include the article (`an` is just an alias of `a`, they're equivalent) |
|
|
||||||
| `:use` <br> `:spend` | After this occurrence, the term is 'used', i.e. the usage counter is increased by 1. Write `@term:use:noindex[]` to uniquely control the usage counter without output. |
|
|
||||||
| `:nouse` <br> `:nospend` | After this occurrence, the usage counter remains exactly as the same as before. As if the term is transparent with respect to the usage counter. |
|
|
||||||
|
|
||||||
### Generating the Glossary
|
### Generating the Glossary
|
||||||
|
|
||||||
@@ -303,7 +244,7 @@ Or to just show the empty group (i.e. terms without a group):
|
|||||||
|
|
||||||
### Customizing Term Display
|
### Customizing Term Display
|
||||||
|
|
||||||
Control how terms are styled in the document by providing a custom `show-term` function:
|
Control how terms appear in the document by providing a custom `show-term` function:
|
||||||
|
|
||||||
```typst
|
```typst
|
||||||
#let emph-term(term-body) = { emph(term-body) }
|
#let emph-term(term-body) = { emph(term-body) }
|
||||||
@@ -314,26 +255,6 @@ Control how terms are styled in the document by providing a custom `show-term` f
|
|||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
Terms can be formatted depending on the 'mode' by providing a custom
|
|
||||||
`format-term` function. The mode is one of ("short", "long", "both").
|
|
||||||
|
|
||||||
```typst
|
|
||||||
// When displaying both, reverse the display order by showing
|
|
||||||
// "short (long)" instead of the normal "long (short)"
|
|
||||||
#let short-long-term(mode, short-form, long-form) = {
|
|
||||||
if mode == "short" { short-form }
|
|
||||||
else if mode == "long" { long-form }
|
|
||||||
else { // mode assumed to be "both"
|
|
||||||
short-form + " (" + long-form + ")"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#show: init-glossary.with(
|
|
||||||
myGlossary,
|
|
||||||
format-term: short-long-term
|
|
||||||
)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Glossary Themes
|
### Glossary Themes
|
||||||
|
|
||||||
#### Included Themes
|
#### Included Themes
|
||||||
@@ -379,7 +300,7 @@ Customize glossary appearance by defining a theme with three functions:
|
|||||||
columns: (auto, 1fr, auto),
|
columns: (auto, 1fr, auto),
|
||||||
output,
|
output,
|
||||||
repeat([#h(0.25em) . #h(0.25em)]),
|
repeat([#h(0.25em) . #h(0.25em)]),
|
||||||
entry.pages.join(", "),
|
entry.pages,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -392,24 +313,11 @@ Entry fields available to themes:
|
|||||||
- `long`: Long form (can be `none`)
|
- `long`: Long form (can be `none`)
|
||||||
- `description`: Term description (can be `none`)
|
- `description`: Term description (can be `none`)
|
||||||
- `label`: Term's dictionary label
|
- `label`: Term's dictionary label
|
||||||
- `pages`: Array of linked page numbers where term appears
|
- `pages`: Linked page numbers where term appears
|
||||||
|
|
||||||
**NOTE:** If the theme does not emit `entry.label`, linking from terms to their
|
**NOTE:** If the theme does not emit `entry.label`, linking form terms to their
|
||||||
glossary entry will not work.
|
glossary entry will not work.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This project is licensed under the MIT License.
|
This project is licensed under the MIT License.
|
||||||
|
|
||||||
## Changelog
|
|
||||||
|
|
||||||
### v0.9.0
|
|
||||||
- **Breaking**: In themes, entry.pages now returns an array of linked
|
|
||||||
page numbers, instead of opaque content. Use `#entry.pages.join(", ")`
|
|
||||||
in your custom theme to keep the previous behaviour.
|
|
||||||
- **Breaking**: The `both` mode (previously called modifier) by default
|
|
||||||
now counts towards the first use of a term.
|
|
||||||
- **Breaking**: When multiple conflicting modes are supplied (like 'short'
|
|
||||||
and 'long'), glossy now throws an error (with a clear message).
|
|
||||||
- **Breaking**: When an unrecognized modifier is supplied with the term,
|
|
||||||
glossy will now panic instead of ignoring the modifier.
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
watchexec \
|
||||||
|
--watch . \
|
||||||
|
--clear \
|
||||||
|
--ignore 'tests/**/diff/**' \
|
||||||
|
--ignore 'tests/**/out/**' \
|
||||||
|
"typst-test r"
|
||||||
@@ -1,151 +0,0 @@
|
|||||||
# Global settings
|
|
||||||
set shell := ["bash", "-eu", "-o", "pipefail", "-c"]
|
|
||||||
set unstable := true
|
|
||||||
|
|
||||||
# Tooling knobs (overridable via env)
|
|
||||||
TT := env_var_or_default("TT", "tt")
|
|
||||||
TT_JOBS := env_var_or_default("TT_JOBS", "4")
|
|
||||||
TYPST := env_var_or_default("TYPST", "typst")
|
|
||||||
TYPSTYLE := env_var_or_default("TYPSTYLE", "typstyle")
|
|
||||||
|
|
||||||
# Paths
|
|
||||||
THUMB_SRC := "tests/demo/test.typ"
|
|
||||||
THUMB_OUT := "thumbnail.png"
|
|
||||||
THEME_SRC := "tests/theme-gallery/test.typ"
|
|
||||||
THEME_OUT := "themeshots.png"
|
|
||||||
DEMO_SRC := "tests/demo/test.typ"
|
|
||||||
DEMO_OUT := "build/demo.pdf"
|
|
||||||
|
|
||||||
# Aliases
|
|
||||||
alias c := check
|
|
||||||
alias f := fmt
|
|
||||||
alias t := test
|
|
||||||
alias w := watch
|
|
||||||
|
|
||||||
# Default entrypoint
|
|
||||||
[default]
|
|
||||||
help:
|
|
||||||
@just --list --unsorted
|
|
||||||
|
|
||||||
# ---------------------------- CI / quality ----------------------------
|
|
||||||
|
|
||||||
# Format all Typst files
|
|
||||||
[group('ci')]
|
|
||||||
fmt:
|
|
||||||
rg --files -g '*.typ' | xargs -r {{TYPSTYLE}} --inplace
|
|
||||||
|
|
||||||
# Check formatting without modifying files
|
|
||||||
[group('ci')]
|
|
||||||
fmt-check:
|
|
||||||
rg --files -g '*.typ' | xargs -r {{TYPSTYLE}} --check
|
|
||||||
|
|
||||||
# Run all quality checks
|
|
||||||
[group('ci')]
|
|
||||||
check: fmt-check test
|
|
||||||
|
|
||||||
# Run tests with optional arguments
|
|
||||||
[group('ci')]
|
|
||||||
test *args:
|
|
||||||
{{TT}} run --jobs {{TT_JOBS}} {{args}}
|
|
||||||
|
|
||||||
# Accept test outputs as new references
|
|
||||||
[group('ci')]
|
|
||||||
accept *args:
|
|
||||||
{{TT}} accept {{args}}
|
|
||||||
|
|
||||||
# ---------------------------- Dev UX ----------------------------
|
|
||||||
|
|
||||||
# Watch for changes and run tests automatically
|
|
||||||
[group('dev')]
|
|
||||||
watch *args:
|
|
||||||
watchexec \
|
|
||||||
--watch . \
|
|
||||||
--clear \
|
|
||||||
--delay-run 5s \
|
|
||||||
--ignore 'tests/**/diff/**' \
|
|
||||||
--ignore 'tests/**/out/**' \
|
|
||||||
--ignore 'tests/**/ref/**' \
|
|
||||||
"{{TT}} run --jobs {{TT_JOBS}} {{args}}"
|
|
||||||
|
|
||||||
# ---------------------------- Artifacts ----------------------------
|
|
||||||
|
|
||||||
# Build demo.typ -> demo.pdf
|
|
||||||
[group('artifacts')]
|
|
||||||
demo:
|
|
||||||
mkdir -p "$(dirname {{DEMO_OUT}})"
|
|
||||||
{{TYPST}} compile --root . {{DEMO_SRC}} {{DEMO_OUT}}
|
|
||||||
@echo "Wrote {{DEMO_OUT}}"
|
|
||||||
|
|
||||||
# Build all preview images
|
|
||||||
# Build all preview images
|
|
||||||
[group('artifacts')]
|
|
||||||
images:
|
|
||||||
{{TT}} run theme-gallery && cp tests/theme-gallery/out/*.png {{THEME_OUT}}
|
|
||||||
{{TT}} run demo && cp tests/demo/out/*.png {{THUMB_OUT}}
|
|
||||||
|
|
||||||
# ---------------------------- Housekeeping ----------------------------
|
|
||||||
|
|
||||||
# Remove all generated test files and build artifacts
|
|
||||||
[group('housekeeping')]
|
|
||||||
clean:
|
|
||||||
rg --files tests -g '**/diff/**' -g '**/out/**' 2>/dev/null \
|
|
||||||
| xargs -r dirname \
|
|
||||||
| sort -u \
|
|
||||||
| xargs -r bash -c 'for d; do echo "Removing files under: $d"; rm -rf -- "$d"/*; done' _ \
|
|
||||||
|| true
|
|
||||||
rm -rf build
|
|
||||||
|
|
||||||
# ---------------------------- Release tooling ----------------------------
|
|
||||||
|
|
||||||
# Bump version by level (major|minor|patch) or to explicit version
|
|
||||||
[group('release')]
|
|
||||||
[script("python3")]
|
|
||||||
bump version_or_level:
|
|
||||||
import re
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
arg = "{{version_or_level}}".strip()
|
|
||||||
if not arg:
|
|
||||||
raise SystemExit("Usage: just bump <major|minor|patch|x.y.z>")
|
|
||||||
|
|
||||||
# If it's a level keyword, calculate the new version
|
|
||||||
if arg.lower() in {"major", "minor", "patch"}:
|
|
||||||
level = arg.lower()
|
|
||||||
data = Path("typst.toml").read_text()
|
|
||||||
m = re.search(r'^version\s*=\s*"([^"]+)"', data, re.MULTILINE)
|
|
||||||
if not m:
|
|
||||||
raise SystemExit("Could not find current version in typst.toml")
|
|
||||||
|
|
||||||
major, minor, patch = map(int, m.group(1).split("."))
|
|
||||||
old_version = m.group(1)
|
|
||||||
|
|
||||||
if level == "major":
|
|
||||||
major, minor, patch = major + 1, 0, 0
|
|
||||||
elif level == "minor":
|
|
||||||
major, minor, patch = major, minor + 1, 0
|
|
||||||
else:
|
|
||||||
patch += 1
|
|
||||||
|
|
||||||
version = f"{major}.{minor}.{patch}"
|
|
||||||
print(f"Bumping {level} version: {old_version} → {version}")
|
|
||||||
else:
|
|
||||||
# It's an explicit version
|
|
||||||
version = arg
|
|
||||||
print(f"Setting version to {version}")
|
|
||||||
|
|
||||||
# Update files
|
|
||||||
def update(path: Path, pattern: re.Pattern):
|
|
||||||
text = path.read_text()
|
|
||||||
new_text, count = pattern.subn(lambda m: m.group(1) + version + m.group(3), text, count=1)
|
|
||||||
if count == 0:
|
|
||||||
raise SystemExit(f"Failed to update {path}")
|
|
||||||
path.write_text(new_text)
|
|
||||||
|
|
||||||
update(Path("typst.toml"), re.compile(r'^(version\s*=\s*")([^"]+)(")', re.MULTILINE))
|
|
||||||
update(Path("README.md"), re.compile(r'(#import "@preview/glossy:)([^"]+)(": \*)'))
|
|
||||||
print(f"Updated typst.toml and README.md")
|
|
||||||
|
|
||||||
|
|
||||||
# Run full pre-submission checks
|
|
||||||
[group('release')]
|
|
||||||
pre-submit: clean images check
|
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
#import "src/gloss.typ": glossary, init-glossary
|
#import "src/gloss.typ": init-glossary, glossary
|
||||||
#import "src/themes.typ": *
|
#import "src/themes.typ": *
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
longplural: entry.at("longplural", default: __pluralize(long)),
|
longplural: entry.at("longplural", default: __pluralize(long)),
|
||||||
longarticle: entry.at("longarticle", default: __determine_article(long)),
|
longarticle: entry.at("longarticle", default: __determine_article(long)),
|
||||||
description: entry.at("description", default: none),
|
description: entry.at("description", default: none),
|
||||||
group: entry.at("group", default: ""),
|
group: entry.at("group", default: "")
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,8 +135,7 @@
|
|||||||
label(__gloss_label_prefix + key + __gloss_entry_postfix)
|
label(__gloss_label_prefix + key + __gloss_entry_postfix)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Updates the term usage (first use counter & wants to be referenced counter)
|
// Updates the term usage in the glossary state.
|
||||||
// in the glossary state.
|
|
||||||
//
|
//
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// key (string): The glossary entry key
|
// key (string): The glossary entry key
|
||||||
@@ -144,18 +143,14 @@
|
|||||||
// Returns:
|
// Returns:
|
||||||
// none: Updates state as a side effect
|
// none: Updates state as a side effect
|
||||||
//
|
//
|
||||||
#let __mark_term_used(key, count-as-referenced, count-as-first-use) = {
|
#let __mark_term_used(key, count-as-first-use) = {
|
||||||
if count-as-referenced {
|
counter(__gloss_label_prefix + key).step()
|
||||||
counter(__gloss_label_prefix + key).step()
|
|
||||||
}
|
|
||||||
if count-as-first-use {
|
if count-as-first-use {
|
||||||
counter(
|
counter(__gloss_label_prefix + key + __gloss_first_use_counter_postfix).step()
|
||||||
__gloss_label_prefix + key + __gloss_first_use_counter_postfix,
|
|
||||||
).step()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Queries whether the term wants to be referenced from ANYWHERE
|
// Queries whether the term is used ANYWHERE
|
||||||
//
|
//
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// key (string): The glossary entry key
|
// key (string): The glossary entry key
|
||||||
@@ -164,9 +159,9 @@
|
|||||||
// Returns:
|
// Returns:
|
||||||
// boolean: If the entry is used above the location in the document
|
// boolean: If the entry is used above the location in the document
|
||||||
//
|
//
|
||||||
#let __is_term_ever_referenced(key, location: none) = {
|
#let __is_term_ever_used(key, location: none) = {
|
||||||
let c = counter(__gloss_label_prefix + key)
|
let c = counter(__gloss_label_prefix + key)
|
||||||
c = if location == none { c.final() } else { c.at(location) }
|
c = if location == none {c.final()} else {c.at(location)}
|
||||||
c.at(0) > 0
|
c.at(0) > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,27 +178,11 @@
|
|||||||
// boolean: If the entry is used above the location in the document
|
// boolean: If the entry is used above the location in the document
|
||||||
//
|
//
|
||||||
#let __is_term_first_used(key, location: none) = {
|
#let __is_term_first_used(key, location: none) = {
|
||||||
let c = counter(
|
let c = counter(__gloss_label_prefix + key + __gloss_first_use_counter_postfix)
|
||||||
__gloss_label_prefix + key + __gloss_first_use_counter_postfix,
|
c = if location == none {c.final()} else {c.at(location)}
|
||||||
)
|
|
||||||
c = if location == none { c.final() } else { c.at(location) }
|
|
||||||
c.at(0) > 0
|
c.at(0) > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset the first use counter to 0
|
|
||||||
//
|
|
||||||
// Parameters:
|
|
||||||
// key (string): The glossary entry key
|
|
||||||
//
|
|
||||||
// Returns:
|
|
||||||
// none: Updates state as a side effect
|
|
||||||
//
|
|
||||||
#let __reset_term_first_used(key, location: none) = {
|
|
||||||
counter(
|
|
||||||
__gloss_label_prefix + key + __gloss_first_use_counter_postfix,
|
|
||||||
).update(0)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Determine if the glossary contains a visible entry
|
// Determine if the glossary contains a visible entry
|
||||||
//
|
//
|
||||||
// Parameters:
|
// Parameters:
|
||||||
@@ -228,6 +207,8 @@
|
|||||||
// - "long": Show only the long form.
|
// - "long": Show only the long form.
|
||||||
// - "def" or "desc": Show the term's description instead of its name.
|
// - "def" or "desc": Show the term's description instead of its name.
|
||||||
// - "a" or "an": Prepend an article, chosen from the entry (short or long form).
|
// - "a" or "an": Prepend an article, chosen from the entry (short or long form).
|
||||||
|
// - "hide" or "hidden": Use term (for the sake of the glossary/index),
|
||||||
|
// but don't display it.
|
||||||
// show-term (function): A function that renders the chosen term.
|
// show-term (function): A function that renders the chosen term.
|
||||||
// term-links (boolean): If terms should be clickable links leading to glossary
|
// term-links (boolean): If terms should be clickable links leading to glossary
|
||||||
//
|
//
|
||||||
@@ -242,88 +223,18 @@
|
|||||||
// content: The fully formatted term, including optional article, capitalization,
|
// content: The fully formatted term, including optional article, capitalization,
|
||||||
// usage tracking metadata, and the chosen form (short, long, or both).
|
// usage tracking metadata, and the chosen form (short, long, or both).
|
||||||
//
|
//
|
||||||
#let __gls(
|
#let __gls(key, modifiers: array, format-term: function, show-term: function, term-links: true, display-text: none) = {
|
||||||
key,
|
|
||||||
modes-modifiers: array,
|
|
||||||
format-term: function,
|
|
||||||
show-term: function,
|
|
||||||
term-links: true,
|
|
||||||
display-text: none,
|
|
||||||
) = {
|
|
||||||
let possible_modes = (
|
|
||||||
"auto",
|
|
||||||
"both",
|
|
||||||
"short",
|
|
||||||
"long",
|
|
||||||
"supplement",
|
|
||||||
"description",
|
|
||||||
"reset",
|
|
||||||
)
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Normalize mode & modifier inputs AND check if the modifiers are valid
|
// Check for illegal modifier combinations
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
let modes-modifiers = modes-modifiers.map(it => {
|
if ("def" in modifiers or "desc" in modifiers) and modifiers.len() > 1 {
|
||||||
if it == "def" or it == "desc" {
|
panic("Cannot use 'def'/'desc' with other modifiers.")
|
||||||
return "description"
|
|
||||||
} else if it == "a" or it == "an" {
|
|
||||||
return "an"
|
|
||||||
} else if it == "use" or it == "spend" {
|
|
||||||
return "use"
|
|
||||||
} else if it == "nouse" or it == "nospend" {
|
|
||||||
return "no-use"
|
|
||||||
} else if it == "noref" or it == "noindex" {
|
|
||||||
return "noindex"
|
|
||||||
} else if it in ("both", "short", "long", "reset", "cap", "pl") {
|
|
||||||
return it
|
|
||||||
} else if it in ("auto", "description", "supplement") {
|
|
||||||
panic(
|
|
||||||
it,
|
|
||||||
"is a valid mode, but is not used by applying a modifier with this name. Read the documentation.",
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
panic(it, "is not a recognized mode or modifier.")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if display-text != none and display-text != auto {
|
|
||||||
// A supplement is provided, thus the mode is "supplement"
|
|
||||||
modes-modifiers.push("supplement")
|
|
||||||
}
|
}
|
||||||
|
if ("a" in modifiers or "an" in modifiers) and ("pl" in modifiers) {
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// Determine the requested modes (plural) and the modifier array
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
modes-modifiers.push("__MIDDLE_ITEM") // unused modifier
|
|
||||||
let (requested_modes, modifiers) = modes-modifiers
|
|
||||||
.sorted(key: it => {
|
|
||||||
if it in possible_modes {
|
|
||||||
// It is a 'mode'
|
|
||||||
return -1
|
|
||||||
} else if it == "__MIDDLE_ITEM" {
|
|
||||||
return 0
|
|
||||||
} else {
|
|
||||||
// It is a 'modifier'
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.split("__MIDDLE_ITEM")
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// Check for illegal mode and/or modifier combinations
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
if requested_modes.len() > 1 {
|
|
||||||
panic("Cannot mix modes ", requested_modes, ", pick one.")
|
|
||||||
}
|
|
||||||
if "description" in requested_modes and modifiers.len() > 0 {
|
|
||||||
panic("Cannot use mode 'def'/'desc' with other modifiers.")
|
|
||||||
}
|
|
||||||
if "reset" in requested_modes and modifiers.len() > 0 {
|
|
||||||
panic("Cannot use mode 'reset' with other modifiers.")
|
|
||||||
}
|
|
||||||
if "an" in modifiers and "pl" in modifiers {
|
|
||||||
panic("Cannot use 'a'/'an' and 'pl' together.")
|
panic("Cannot use 'a'/'an' and 'pl' together.")
|
||||||
}
|
}
|
||||||
if "use" in modifiers and "no-use" in modifiers {
|
if ("hidden" in modifiers or "hide" in modifiers) and modifiers.len() > 1{
|
||||||
panic("Cannot use 'use'/'spend' and 'nouse'/'nospend' together.")
|
panic("Cannot use 'hide'/'hidden' with other modifiers.")
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
@@ -332,47 +243,24 @@
|
|||||||
let entry = __get_entry(key)
|
let entry = __get_entry(key)
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Determine the requested mode (singular)
|
// If "def" or "desc" modifier is present, show the entry's description immediately
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
let requested_mode = if requested_modes.len() == 0 {
|
if "def" in modifiers or "desc" in modifiers {
|
||||||
"auto"
|
|
||||||
} else {
|
|
||||||
requested_modes.at(0)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// If mode is "description", show the entry's description immediately
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
if requested_mode == "description" {
|
|
||||||
if entry.description == none {
|
if entry.description == none {
|
||||||
panic("Use of 'def'/'desc' requires a description be defined.")
|
panic("Use of 'def'/'desc' requires a description be defined.")
|
||||||
}
|
}
|
||||||
return show-term([#entry.description])
|
return show-term([#entry.description])
|
||||||
}
|
}
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// If mode is "reset", reset the (first) usage counter and return immediately
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
if requested_mode == "reset" {
|
|
||||||
__reset_term_first_used(key)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Manage term usage counting and determine if it's the first reference
|
// Manage term usage counting and determine if it's the first reference
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
let is_first_use = not __is_term_first_used(key, location: here())
|
let is_first_use = not __is_term_first_used(key, location: here())
|
||||||
let default-count-as-first-use = (
|
let count-as-first-use = ("short" not in modifiers and "long" not in modifiers and "both" not in modifiers)
|
||||||
requested_mode == "auto" or requested_mode == "both"
|
let wants_reference = ("noref" not in modifiers and "noindex" not in modifiers)
|
||||||
)
|
if wants_reference {
|
||||||
let force-count-as-first-use = "use" in modifiers
|
__mark_term_used(key, count-as-first-use)
|
||||||
let force-skip-as-first-use = "no-use" in modifiers
|
}
|
||||||
let wants_reference = "noindex" not in modifiers
|
|
||||||
__mark_term_used(
|
|
||||||
key,
|
|
||||||
wants_reference,
|
|
||||||
force-count-as-first-use
|
|
||||||
or (not force-skip-as-first-use and default-count-as-first-use),
|
|
||||||
)
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Helper Functions
|
// Helper Functions
|
||||||
@@ -394,7 +282,7 @@
|
|||||||
let capitalize_term = (article, term) => {
|
let capitalize_term = (article, term) => {
|
||||||
if "cap" not in modifiers {
|
if "cap" not in modifiers {
|
||||||
(article, term)
|
(article, term)
|
||||||
} else if article == none {
|
} else if article == "" {
|
||||||
// No article present, so capitalize the term's first letter.
|
// No article present, so capitalize the term's first letter.
|
||||||
(article, upper(term.first()) + term.slice(1))
|
(article, upper(term.first()) + term.slice(1))
|
||||||
} else {
|
} else {
|
||||||
@@ -404,14 +292,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get_article(mode): Returns the appropriate article string based on the mode.
|
// get_article(mode): Returns the appropriate article string based on the mode.
|
||||||
// - If wants_article is false, returns none
|
// - If wants_article is false, returns an empty string.
|
||||||
// - If mode is "short", return the short article.
|
// - If mode is "short", return the short article.
|
||||||
// - If mode is "long" or "both", return the long article.
|
// - If mode is "long" or "both", return the long article.
|
||||||
// The calling logic ensures that when mode = "long" or "both", a long form exists.
|
// The calling logic ensures that when mode = "long" or "both", a long form exists.
|
||||||
let get_article = mode => {
|
let get_article = (mode) => {
|
||||||
let wants_article = "an" in modifiers
|
let wants_article = "a" in modifiers or "an" in modifiers
|
||||||
if not wants_article {
|
if not wants_article {
|
||||||
none
|
""
|
||||||
} else if mode == "short" {
|
} else if mode == "short" {
|
||||||
entry.article + " "
|
entry.article + " "
|
||||||
} else {
|
} else {
|
||||||
@@ -420,41 +308,67 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// determine_mode(wants_both, wants_long, wants_short, is_first_use, long_available):
|
||||||
// Determine desired options based on modifiers and entry.long availability
|
// Decides which mode ("short", "long", or "both") to use.
|
||||||
// ---------------------------------------------------------------------------
|
// Preference is given to explicit modifiers. If the requested mode can't be fulfilled due to no long form,
|
||||||
// Decide which mode ("short", "long", or "both" or "supplement") to use.
|
// fall back to "short".
|
||||||
// If the requested mode can't be fulfilled due to no long form, fall back to "short".
|
// If no explicit mode is given, the default behavior is:
|
||||||
// If no explicit mode is given (i.e. we are in 'auto' mode), the default behavior is:
|
|
||||||
// - On first use and if a long form exists, "both".
|
// - On first use and if a long form exists, "both".
|
||||||
// - Otherwise, "short".
|
// - Otherwise, "short".
|
||||||
if requested_mode == "auto" {
|
let determine_mode = (wants_both, wants_long, wants_short, is_first_use, long_available, wants_hidden) => {
|
||||||
// Set requested_mode to automatically determined mode
|
if wants_hidden {
|
||||||
requested_mode = if is_first_use {
|
// If it's hidden, nothing else matters
|
||||||
"both"
|
"hidden"
|
||||||
} else {
|
} else if wants_both {
|
||||||
|
// Explicit request for "both":
|
||||||
|
// If a long form exists, use "both", otherwise fall back to "short".
|
||||||
|
if long_available {
|
||||||
|
"both"
|
||||||
|
} else {
|
||||||
|
"short"
|
||||||
|
}
|
||||||
|
} else if wants_long {
|
||||||
|
// Explicit request for "long":
|
||||||
|
// If a long form exists, use "long", otherwise fall back to "short".
|
||||||
|
if long_available {
|
||||||
|
"long"
|
||||||
|
} else {
|
||||||
|
"short"
|
||||||
|
}
|
||||||
|
} else if wants_short {
|
||||||
|
// Explicit request for "short":
|
||||||
|
// Always "short" regardless of availability.
|
||||||
"short"
|
"short"
|
||||||
|
} else {
|
||||||
|
// No explicit mode given:
|
||||||
|
// On first use with a long form available, default to "both".
|
||||||
|
// Otherwise, use "short".
|
||||||
|
if is_first_use and long_available {
|
||||||
|
"both"
|
||||||
|
} else {
|
||||||
|
"short"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
// Determine desired options based on modifiers and entry.long availability
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
let wants_both = "both" in modifiers
|
||||||
|
let wants_long = "long" in modifiers
|
||||||
|
let wants_short = "short" in modifiers
|
||||||
|
let wants_hidden = ("hidden" in modifiers or "hide" in modifiers)
|
||||||
let long_available = entry.long != none
|
let long_available = entry.long != none
|
||||||
let mode = if (
|
|
||||||
(requested_mode == "both" or requested_mode == "long")
|
// Determine mode using the helper function
|
||||||
and not long_available
|
let mode = determine_mode(wants_both, wants_long, wants_short, is_first_use, long_available, wants_hidden)
|
||||||
) {
|
|
||||||
// The fall back case, because long form is not available, but it is requested
|
|
||||||
"short"
|
|
||||||
} else {
|
|
||||||
// No fall back needed, the requested mode can be fulfilled
|
|
||||||
requested_mode
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pluralize (if requested)
|
// Pluralize (if requested)
|
||||||
let short-form = pluralize_term(entry.short, entry.plural)
|
let short-form = pluralize_term(entry.short, entry.plural)
|
||||||
let long-form = pluralize_term(entry.long, entry.longplural) // `none` safe here
|
let long-form = pluralize_term(entry.long, entry.longplural) // `none` safe here
|
||||||
|
|
||||||
// Apply format-term() to get the term
|
// Apply format-term() to get the term
|
||||||
let formatted-term = if mode == "supplement" {
|
let formatted-term = if display-text != none and display-text != auto {
|
||||||
// Display text was overriden by user, just accept it (string or content)
|
// Display text was overriden by user, just accept it (string or content)
|
||||||
display-text
|
display-text
|
||||||
} else {
|
} else {
|
||||||
@@ -466,7 +380,7 @@
|
|||||||
// that with content, thus requiring a string here.
|
// that with content, thus requiring a string here.
|
||||||
// TODO: consider if we want to capitalize *before* this. First intuition is
|
// TODO: consider if we want to capitalize *before* this. First intuition is
|
||||||
// "no".
|
// "no".
|
||||||
panic("Your custom format-term() function must return a string.")
|
panic("Your cutsom format-term() function must return a string.")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the article, then capitalize either the article or term (if requested)
|
// Get the article, then capitalize either the article or term (if requested)
|
||||||
@@ -476,7 +390,7 @@
|
|||||||
// Construct and return the final output
|
// Construct and return the final output
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
context {
|
context {
|
||||||
let linked-term = if term-links and __has_glossary_entry(key) {
|
let linked-term = if term-links and query(__entry_label(key)).len() > 0 {
|
||||||
link(__entry_label(key), term)
|
link(__entry_label(key), term)
|
||||||
} else {
|
} else {
|
||||||
term
|
term
|
||||||
@@ -489,44 +403,57 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create the output content
|
// Create the output content
|
||||||
[#article#show-term(linked-term)#metadata(term)#term-label]
|
if mode == "hidden" {
|
||||||
// |^^^^^|^^^^^^^^^ |^^^^^^^^ |^^^^^^^^^^
|
// just put the metadata+label out there
|
||||||
// | | | \_ the label for backlink from
|
[#metadata("hidden term")#term-label]
|
||||||
// | | | glossary i.e. <__gloss:key>, etc.
|
} else {
|
||||||
// | | \_ metadata lets us label (ie makes it "labelable")
|
// normal term display (ie not hidden)
|
||||||
// | \_ apply user formatting function to the term
|
|
||||||
// \_art.
|
// create the forward link, if watned
|
||||||
|
let linked-term = if term-links and __has_glossary_entry(key) {
|
||||||
|
link(label(key), term)
|
||||||
|
} else {
|
||||||
|
term
|
||||||
|
}
|
||||||
|
|
||||||
|
// and the final content
|
||||||
|
[#article#show-term(linked-term)#metadata(term)#term-label]
|
||||||
|
// |^^^^^|^^^^^^^^^ |^^^^^^^^ |^^^^^^^^^^^^
|
||||||
|
// \_art.| | |
|
||||||
|
// \_ apply user formatting function to the term
|
||||||
|
// | |
|
||||||
|
// \_ metadata lets us label (ie makes it "labelable")
|
||||||
|
// |
|
||||||
|
// \_ i.e. <__gloss:key>, etc.
|
||||||
|
// for backlink from glossary
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Creates page number links back to each usage of a glossary term.
|
// Creates page number links back to each usage of a glossary term.
|
||||||
//
|
//
|
||||||
// This function generates an array of page numbers, where each number links
|
// This function generates a comma-separated list of page numbers, where each
|
||||||
// back to a usage of the term in the document. Duplicate page numers are
|
// number links back to a usage of the term in the document. Duplicate page
|
||||||
// removed to avoid redundancy.
|
// numbers are removed to avoid redundancy.
|
||||||
//
|
//
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// key (string): The glossary entry key
|
// key (string): The glossary entry key
|
||||||
//
|
//
|
||||||
// Returns:
|
// Returns:
|
||||||
// array: Linked page numbers
|
// content: Comma-separated list of linked page numbers
|
||||||
//
|
//
|
||||||
// Example output after a typical .join(", "):
|
// Example output: "1, 3, 5" where each number links to the term usage on that page
|
||||||
// "1, 3, 5" where each number links to the term usage on that page
|
|
||||||
//
|
//
|
||||||
#let __create_backlinks(key) = {
|
#let __create_backlinks(key) = {
|
||||||
return query(__term_label(key)) // find all reference
|
return context query(__term_label(key)) // find all reference
|
||||||
.map(meta => {
|
.map(meta => { // extract location and page number (or symbol)
|
||||||
// extract location and page number (or symbol)
|
|
||||||
let loc = meta.location()
|
let loc = meta.location()
|
||||||
let page = numbering(
|
let page = numbering(__default(loc.page-numbering(), "1"), ..counter(page).at(loc))
|
||||||
__default(loc.page-numbering(), "1"),
|
|
||||||
..counter(page).at(loc),
|
|
||||||
)
|
|
||||||
(loc, page)
|
(loc, page)
|
||||||
})
|
})
|
||||||
.dedup(key: ((loc, page)) => page) // deduplicate by page
|
.dedup(key: ((loc, page)) => page) // deduplicate by page
|
||||||
.map(((loc, page)) => link(loc, page)) // create links
|
.map(((loc, page)) => link(loc, page)) // create links
|
||||||
|
.join(", ")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Formats a term string based on the specified mode.
|
// Formats a term string based on the specified mode.
|
||||||
@@ -547,14 +474,14 @@
|
|||||||
// string: The formatted term based on the specified mode.
|
// string: The formatted term based on the specified mode.
|
||||||
//
|
//
|
||||||
#let __default-format-term(mode, short-form, long-form) = {
|
#let __default-format-term(mode, short-form, long-form) = {
|
||||||
if mode == "short" {
|
if mode == "short" {
|
||||||
short-form
|
short-form
|
||||||
} else if mode == "long" {
|
} else if mode == "long" {
|
||||||
long-form
|
long-form
|
||||||
} else {
|
} else {
|
||||||
// mode assumed to be "both"
|
// mode assumed to be "both"
|
||||||
long-form + " (" + short-form + ")"
|
long-form + " (" + short-form + ")"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Styles a term to control its display in a document.
|
// Styles a term to control its display in a document.
|
||||||
@@ -598,23 +525,17 @@
|
|||||||
format-term: __default-format-term,
|
format-term: __default-format-term,
|
||||||
show-term: __default-show-term,
|
show-term: __default-show-term,
|
||||||
term-links: false,
|
term-links: false,
|
||||||
body,
|
body
|
||||||
) = context {
|
) = context {
|
||||||
// Type checking
|
// Type checking
|
||||||
let checked-entries = (:)
|
let checked-entries = (:)
|
||||||
for (key, entry) in entries {
|
for (key, entry) in entries {
|
||||||
let checked-key = z.parse(key, z.string(), scope: ("dictionary key",))
|
let checked-key = z.parse(key, z.string(), scope: ("dictionary key",))
|
||||||
let checked-entry = z.parse(entry, dict-schema, scope: (
|
let checked-entry = z.parse(entry, dict-schema, scope: ("dictionary entry",))
|
||||||
"dictionary entry",
|
|
||||||
))
|
|
||||||
checked-entries.insert(checked-key, checked-entry)
|
checked-entries.insert(checked-key, checked-entry)
|
||||||
}
|
}
|
||||||
let checked-format-term = z.parse(show-term, z.function(), scope: (
|
let checked-format-term = z.parse(show-term, z.function(), scope: ("format-term",))
|
||||||
"format-term",
|
let checked-show-term = z.parse(show-term, z.function(), scope: ("show-term",))
|
||||||
))
|
|
||||||
let checked-show-term = z.parse(show-term, z.function(), scope: (
|
|
||||||
"show-term",
|
|
||||||
))
|
|
||||||
let checked-body = z.parse(body, z.content(), scope: ("body",))
|
let checked-body = z.parse(body, z.content(), scope: ("body",))
|
||||||
|
|
||||||
// Process and store each glossary entry
|
// Process and store each glossary entry
|
||||||
@@ -635,12 +556,7 @@
|
|||||||
// - That "key" does not correspond to an actual entry,
|
// - That "key" does not correspond to an actual entry,
|
||||||
// - There is at least one modifier,
|
// - There is at least one modifier,
|
||||||
// - The first modifier corresponds to an existing entry key.
|
// - The first modifier corresponds to an existing entry key.
|
||||||
let can_swap = (
|
let can_swap = (lower(raw_key) == "a" or lower(raw_key) == "an") and not __has_entry(raw_key) and raw_modifiers.len() > 0 and __has_entry(raw_modifiers.first())
|
||||||
(lower(raw_key) == "a" or lower(raw_key) == "an")
|
|
||||||
and not __has_entry(raw_key)
|
|
||||||
and raw_modifiers.len() > 0
|
|
||||||
and __has_entry(raw_modifiers.first())
|
|
||||||
)
|
|
||||||
|
|
||||||
// If we can swap, use the first modifier as the key and insert "a" as the first modifier.
|
// If we can swap, use the first modifier as the key and insert "a" as the first modifier.
|
||||||
let (key, modifiers) = if can_swap {
|
let (key, modifiers) = if can_swap {
|
||||||
@@ -652,14 +568,7 @@
|
|||||||
// Now see if this is an actual glossary term key
|
// Now see if this is an actual glossary term key
|
||||||
if __has_entry(key) {
|
if __has_entry(key) {
|
||||||
// Found in dictionary, render via __gls()
|
// Found in dictionary, render via __gls()
|
||||||
__gls(
|
__gls(key, modifiers: modifiers.map(lower), format-term: format-term, show-term: show-term, term-links: term-links, display-text: supplement)
|
||||||
key,
|
|
||||||
modes-modifiers: modifiers.map(lower),
|
|
||||||
format-term: format-term,
|
|
||||||
show-term: show-term,
|
|
||||||
term-links: term-links,
|
|
||||||
display-text: supplement,
|
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
// Not one of ours, so just pass it through
|
// Not one of ours, so just pass it through
|
||||||
r
|
r
|
||||||
@@ -692,7 +601,7 @@
|
|||||||
// - long: Long form of term (optional)
|
// - long: Long form of term (optional)
|
||||||
// - description: Term description (optional)
|
// - description: Term description (optional)
|
||||||
// - label: Term's dictionary label
|
// - label: Term's dictionary label
|
||||||
// - pages: Array of linked page numbers where term appears
|
// - pages: Linked page numbers where term appears
|
||||||
// - index: Zero-based entry index within group
|
// - index: Zero-based entry index within group
|
||||||
// - total: Total entries in group
|
// - total: Total entries in group
|
||||||
// groups (array): Optional list of groups to include
|
// groups (array): Optional list of groups to include
|
||||||
@@ -715,16 +624,14 @@
|
|||||||
// Type checking
|
// Type checking
|
||||||
let checked-title = z.parse(title, z.content(), scope: ("title",))
|
let checked-title = z.parse(title, z.content(), scope: ("title",))
|
||||||
let checked-groups = z.parse(groups, groups-list-schema, scope: ("groups",))
|
let checked-groups = z.parse(groups, groups-list-schema, scope: ("groups",))
|
||||||
let checked-ignore-case = z.parse(ignore-case, z.boolean(), scope: (
|
let checked-ignore-case = z.parse(ignore-case, z.boolean(), scope: ("ignore-case",))
|
||||||
"ignore-case",
|
|
||||||
))
|
|
||||||
let checked-theme = z.parse(theme, theme-schema, scope: ("theme",))
|
let checked-theme = z.parse(theme, theme-schema, scope: ("theme",))
|
||||||
|
|
||||||
// Collect and organize entries by group
|
// Collect and organize entries by group
|
||||||
let output = (:)
|
let output = (:)
|
||||||
let all_entries = __gloss_entries.final()
|
let all_entries = __gloss_entries.final()
|
||||||
let all_used = if not show-all {
|
let all_used = if not show-all {
|
||||||
all_entries.keys().filter(key => __is_term_ever_referenced(key))
|
all_entries.keys().filter(key => __is_term_ever_used(key))
|
||||||
} else {
|
} else {
|
||||||
all_entries.keys()
|
all_entries.keys()
|
||||||
}
|
}
|
||||||
@@ -765,7 +672,7 @@
|
|||||||
long: entry.at("long"),
|
long: entry.at("long"),
|
||||||
description: entry.at("description"),
|
description: entry.at("description"),
|
||||||
label: [#metadata(key)#__entry_label(key)],
|
label: [#metadata(key)#__entry_label(key)],
|
||||||
pages: __create_backlinks(key),
|
pages: __create_backlinks(key)
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -778,9 +685,7 @@
|
|||||||
let sorted_entries = if sort {
|
let sorted_entries = if sort {
|
||||||
current_entries
|
current_entries
|
||||||
// 1. create array of tuples with (lower [if ignore-case], entry)
|
// 1. create array of tuples with (lower [if ignore-case], entry)
|
||||||
.map(e => {
|
.map(e => { if ignore-case { (lower(e.short), e) } else { (e.short, e) } })
|
||||||
if ignore-case { (lower(e.short), e) } else { (e.short, e) }
|
|
||||||
})
|
|
||||||
// 2. sort the tuples (by first element then second)
|
// 2. sort the tuples (by first element then second)
|
||||||
.sorted() // NOTE: sorted() is NOT language-aware
|
.sorted() // NOTE: sorted() is NOT language-aware
|
||||||
// 3. strip away the tuple's first element, leaving an array of entries
|
// 3. strip away the tuple's first element, leaving an array of entries
|
||||||
@@ -808,10 +713,10 @@
|
|||||||
output.len(),
|
output.len(),
|
||||||
for (i, entry) in entries.enumerate() {
|
for (i, entry) in entries.enumerate() {
|
||||||
(checked-theme.entry)(entry, i, entries.len())
|
(checked-theme.entry)(entry, i, entries.len())
|
||||||
},
|
}
|
||||||
)
|
)
|
||||||
group_index += 1
|
group_index += 1
|
||||||
},
|
}
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -10,8 +10,8 @@
|
|||||||
longplural: z.content(optional: true),
|
longplural: z.content(optional: true),
|
||||||
description: z.content(optional: true),
|
description: z.content(optional: true),
|
||||||
group: z.content(optional: true),
|
group: z.content(optional: true),
|
||||||
),
|
)
|
||||||
),
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
#let theme-schema = z.dictionary(
|
#let theme-schema = z.dictionary(
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
section: z.function(),
|
section: z.function(),
|
||||||
group: z.function(),
|
group: z.function(),
|
||||||
entry: z.function(),
|
entry: z.function(),
|
||||||
),
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
#let groups-list-schema = z.array(pre-transform: z.coerce.array)
|
#let groups-list-schema = z.array(pre-transform: z.coerce.array)
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
v(1em)
|
v(1em)
|
||||||
body
|
body
|
||||||
},
|
},
|
||||||
|
|
||||||
group: (name, index, total, body) => {
|
group: (name, index, total, body) => {
|
||||||
if name != "" and total > 1 {
|
if name != "" and total > 1 {
|
||||||
v(1.5em)
|
v(1.5em)
|
||||||
@@ -15,6 +16,7 @@
|
|||||||
}
|
}
|
||||||
body
|
body
|
||||||
},
|
},
|
||||||
|
|
||||||
entry: (entry, index, total) => {
|
entry: (entry, index, total) => {
|
||||||
let short-display = text(weight: "bold", entry.short)
|
let short-display = text(weight: "bold", entry.short)
|
||||||
let long-display = if entry.long == none {
|
let long-display = if entry.long == none {
|
||||||
@@ -38,10 +40,10 @@
|
|||||||
columns: (1fr, auto),
|
columns: (1fr, auto),
|
||||||
gutter: 0.75em,
|
gutter: 0.75em,
|
||||||
[#short-display#long-display#description#entry.label],
|
[#short-display#long-display#description#entry.label],
|
||||||
text(fill: rgb("#666666"), entry.pages.join(", ")),
|
text(fill: rgb("#666666"), entry.pages)
|
||||||
)
|
)
|
||||||
},
|
}
|
||||||
),
|
)
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@@ -15,6 +15,7 @@
|
|||||||
heading(level: 1, title)
|
heading(level: 1, title)
|
||||||
body
|
body
|
||||||
},
|
},
|
||||||
|
|
||||||
// Renders a group of related glossary terms
|
// Renders a group of related glossary terms
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// name: Group name (empty string for ungrouped terms)
|
// name: Group name (empty string for ungrouped terms)
|
||||||
@@ -27,6 +28,7 @@
|
|||||||
}
|
}
|
||||||
body
|
body
|
||||||
},
|
},
|
||||||
|
|
||||||
// Renders a single glossary entry with term, definition, and page references
|
// Renders a single glossary entry with term, definition, and page references
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// entry: Dictionary containing term data:
|
// entry: Dictionary containing term data:
|
||||||
@@ -34,7 +36,7 @@
|
|||||||
// - long: Long form of term (optional)
|
// - long: Long form of term (optional)
|
||||||
// - description: Term description (optional)
|
// - description: Term description (optional)
|
||||||
// - label: Term's dictionary label
|
// - label: Term's dictionary label
|
||||||
// - pages: Array of linked page numbers where term appears
|
// - pages: Linked page numbers where term appears
|
||||||
// index: Zero-based entry index within group
|
// index: Zero-based entry index within group
|
||||||
// total: Total entries in group
|
// total: Total entries in group
|
||||||
entry: (entry, index, total) => {
|
entry: (entry, index, total) => {
|
||||||
@@ -60,9 +62,9 @@
|
|||||||
left: 1em,
|
left: 1em,
|
||||||
bottom: 0.5em,
|
bottom: 0.5em,
|
||||||
block(
|
block(
|
||||||
[#term#entry.label#long-form#description #h(1em) (pp. #entry.pages.join(", "))],
|
[#term#entry.label#long-form#description #h(1em) (pp. #entry.pages)]
|
||||||
),
|
)
|
||||||
),
|
)
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
heading(level: 1, smallcaps(title))
|
heading(level: 1, smallcaps(title))
|
||||||
body
|
body
|
||||||
},
|
},
|
||||||
|
|
||||||
group: (name, index, total, body) => {
|
group: (name, index, total, body) => {
|
||||||
if name != "" and total > 1 {
|
if name != "" and total > 1 {
|
||||||
v(1em)
|
v(1em)
|
||||||
@@ -13,12 +14,13 @@
|
|||||||
}
|
}
|
||||||
body
|
body
|
||||||
},
|
},
|
||||||
|
|
||||||
entry: (entry, index, total) => {
|
entry: (entry, index, total) => {
|
||||||
let short-display = text(weight: "regular", entry.short)
|
let short-display = text(weight: "regular", entry.short)
|
||||||
let long-display = if entry.long == none {
|
let long-display = if entry.long == none {
|
||||||
[]
|
[]
|
||||||
} else {
|
} else {
|
||||||
[ — #entry.long] // Using em-dash for Chicago style
|
[ — #entry.long] // Using em-dash for Chicago style
|
||||||
}
|
}
|
||||||
|
|
||||||
let description = if entry.description == none {
|
let description = if entry.description == none {
|
||||||
@@ -36,10 +38,10 @@
|
|||||||
columns: (1fr, auto),
|
columns: (1fr, auto),
|
||||||
gutter: 1em,
|
gutter: 1em,
|
||||||
[#short-display#entry.label#long-display#description#entry.label],
|
[#short-display#entry.label#long-display#description#entry.label],
|
||||||
[#entry.pages.join(", ")],
|
[#entry.pages]
|
||||||
)
|
)
|
||||||
},
|
}
|
||||||
),
|
)
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
heading(level: 1, outlined: false, text(weight: "bold", size: 1.1em, title))
|
heading(level: 1, outlined: false, text(weight: "bold", size: 1.1em, title))
|
||||||
body
|
body
|
||||||
},
|
},
|
||||||
|
|
||||||
// Renders a group of related glossary terms
|
// Renders a group of related glossary terms
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// name: Group name (empty string for ungrouped terms)
|
// name: Group name (empty string for ungrouped terms)
|
||||||
@@ -29,12 +30,13 @@
|
|||||||
spacing: 0.5em,
|
spacing: 0.5em,
|
||||||
pad(
|
pad(
|
||||||
top: 0.5em,
|
top: 0.5em,
|
||||||
text(weight: "bold", size: 0.9em, name),
|
text(weight: "bold", size: 0.9em, name)
|
||||||
),
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
body
|
body
|
||||||
},
|
},
|
||||||
|
|
||||||
// Renders a single glossary entry with term, definition, and page references
|
// Renders a single glossary entry with term, definition, and page references
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// entry: Dictionary containing term data:
|
// entry: Dictionary containing term data:
|
||||||
@@ -42,7 +44,7 @@
|
|||||||
// - long: Long form of term (optional)
|
// - long: Long form of term (optional)
|
||||||
// - description: Term description (optional)
|
// - description: Term description (optional)
|
||||||
// - label: Term's dictionary label
|
// - label: Term's dictionary label
|
||||||
// - pages: Array of linked page numbers where term appears
|
// - pages: Linked page numbers where term appears
|
||||||
// index: Zero-based entry index within group
|
// index: Zero-based entry index within group
|
||||||
// total: Total entries in group
|
// total: Total entries in group
|
||||||
entry: (entry, index, total) => {
|
entry: (entry, index, total) => {
|
||||||
@@ -51,7 +53,7 @@
|
|||||||
size: 0.65em,
|
size: 0.65em,
|
||||||
weight: "medium",
|
weight: "medium",
|
||||||
fill: gray.darken(60%),
|
fill: gray.darken(60%),
|
||||||
entry.short,
|
entry.short
|
||||||
)
|
)
|
||||||
|
|
||||||
let long-form = if entry.long == none {
|
let long-form = if entry.long == none {
|
||||||
@@ -71,7 +73,7 @@
|
|||||||
spacing: 0.4em,
|
spacing: 0.4em,
|
||||||
grid(
|
grid(
|
||||||
columns: (auto, 1fr, auto),
|
columns: (auto, 1fr, auto),
|
||||||
align: left + bottom,
|
align: left+bottom,
|
||||||
gutter: 0.5em,
|
gutter: 0.5em,
|
||||||
// Term and description column
|
// Term and description column
|
||||||
box[#term#entry.label#long-form #description],
|
box[#term#entry.label#long-form #description],
|
||||||
@@ -81,9 +83,9 @@
|
|||||||
text(
|
text(
|
||||||
size: 0.6em,
|
size: 0.6em,
|
||||||
fill: gray.darken(20%),
|
fill: gray.darken(20%),
|
||||||
entry.pages.join(", "),
|
entry.pages
|
||||||
),
|
)
|
||||||
),
|
)
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@@ -4,13 +4,13 @@
|
|||||||
heading(level: 1, title)
|
heading(level: 1, title)
|
||||||
body
|
body
|
||||||
},
|
},
|
||||||
|
|
||||||
group: (name, index, total, body) => {
|
group: (name, index, total, body) => {
|
||||||
if name != "" and total > 1 {
|
if name != "" and total > 1 {
|
||||||
heading(level: 2, name)
|
heading(level: 2, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
table(
|
table(columns: 4,
|
||||||
columns: 4,
|
|
||||||
stroke: none,
|
stroke: none,
|
||||||
inset: (x, y) => {
|
inset: (x, y) => {
|
||||||
if (x == 0) {
|
if (x == 0) {
|
||||||
@@ -22,15 +22,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
table.header([*Abbreviation*], [*Full Name*], [*Description*], [*Pages*]),
|
table.header([*Abbreviation*], [*Full Name*], [*Description*], [*Pages*]),
|
||||||
..body,
|
..body
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
||||||
entry: (entry, index, total) => {
|
entry: (entry, index, total) => {
|
||||||
(
|
(entry.short + entry.label, entry.long, entry.description, entry.pages)
|
||||||
entry.short + entry.label,
|
}
|
||||||
entry.long,
|
|
||||||
entry.description,
|
|
||||||
entry.pages.join(", "),
|
|
||||||
)
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
@@ -15,6 +15,7 @@
|
|||||||
heading(level: 1, title)
|
heading(level: 1, title)
|
||||||
columns(2, body)
|
columns(2, body)
|
||||||
},
|
},
|
||||||
|
|
||||||
// Renders a group of related glossary terms
|
// Renders a group of related glossary terms
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// name: Group name (empty string for ungrouped terms)
|
// name: Group name (empty string for ungrouped terms)
|
||||||
@@ -27,6 +28,7 @@
|
|||||||
}
|
}
|
||||||
body
|
body
|
||||||
},
|
},
|
||||||
|
|
||||||
// Renders a single glossary entry with term, definition, and page references
|
// Renders a single glossary entry with term, definition, and page references
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// entry: Dictionary containing term data:
|
// entry: Dictionary containing term data:
|
||||||
@@ -34,7 +36,7 @@
|
|||||||
// - long: Long form of term (optional)
|
// - long: Long form of term (optional)
|
||||||
// - description: Term description (optional)
|
// - description: Term description (optional)
|
||||||
// - label: Term's dictionary label
|
// - label: Term's dictionary label
|
||||||
// - pages: Array of linked page numbers where term appears
|
// - pages: Linked page numbers where term appears
|
||||||
// index: Zero-based entry index within group
|
// index: Zero-based entry index within group
|
||||||
// total: Total entries in group
|
// total: Total entries in group
|
||||||
entry: (entry, index, total) => {
|
entry: (entry, index, total) => {
|
||||||
@@ -58,17 +60,13 @@
|
|||||||
size: 0.75em,
|
size: 0.75em,
|
||||||
weight: "light",
|
weight: "light",
|
||||||
grid(
|
grid(
|
||||||
columns: (auto, 1fr, 1em, auto),
|
columns: (auto,1fr,1em,auto),
|
||||||
align: (left, center, center, right),
|
align: (left, center, center, right),
|
||||||
[#short-display#entry.label#long-display#description],
|
[#short-display#entry.label#long-display#description], // Term with label
|
||||||
// Term with label
|
[#repeat(h(0.25em) + "." + h(0.25em))], // Dotted leader line
|
||||||
[#repeat(h(0.25em) + "." + h(0.25em))],
|
[ . ], // A 1em wide dot so we definitely get some break between term and pages
|
||||||
// Dotted leader line
|
[#entry.pages] // Page references
|
||||||
[ . ],
|
)
|
||||||
// A 1em wide dot so we definitely get some break between term and pages
|
|
||||||
[#entry.pages.join(", ")],
|
|
||||||
// Page references
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@@ -16,8 +16,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Helper functions for checking endings
|
// Helper functions for checking endings
|
||||||
let ends_with = suffix => lower(word).ends-with(suffix)
|
let ends_with = (suffix) => lower(word).ends-with(suffix)
|
||||||
let ends_with_any = suffixes => suffixes.any(suffix => ends_with(suffix))
|
let ends_with_any = (suffixes) => suffixes.any((suffix) => ends_with(suffix))
|
||||||
|
|
||||||
// Map of irregular plurals for common words
|
// Map of irregular plurals for common words
|
||||||
let irregulars = (
|
let irregulars = (
|
||||||
@@ -80,18 +80,7 @@
|
|||||||
// Irregular suffixes
|
// Irregular suffixes
|
||||||
let f_to_ves = ("leaf", "loaf", "calf", "half", "wolf", "thief")
|
let f_to_ves = ("leaf", "loaf", "calf", "half", "wolf", "thief")
|
||||||
let fe_to_ves = ("wife", "knife", "life")
|
let fe_to_ves = ("wife", "knife", "life")
|
||||||
let o_to_os = (
|
let o_to_os = ("photo", "piano", "halo", "radio", "video", "studio", "solo", "taco", "memo", "zero")
|
||||||
"photo",
|
|
||||||
"piano",
|
|
||||||
"halo",
|
|
||||||
"radio",
|
|
||||||
"video",
|
|
||||||
"studio",
|
|
||||||
"solo",
|
|
||||||
"taco",
|
|
||||||
"memo",
|
|
||||||
"zero",
|
|
||||||
)
|
|
||||||
|
|
||||||
// Convenience
|
// Convenience
|
||||||
let w = lower(word)
|
let w = lower(word)
|
||||||
@@ -134,7 +123,7 @@
|
|||||||
} else if ends_with("is") {
|
} else if ends_with("is") {
|
||||||
word.slice(0, -2) + "es"
|
word.slice(0, -2) + "es"
|
||||||
} else if ends_with("on") {
|
} else if ends_with("on") {
|
||||||
word + "s"
|
word + "s"
|
||||||
} else if ends_with("o") {
|
} else if ends_with("o") {
|
||||||
if o_to_os.contains(w) {
|
if o_to_os.contains(w) {
|
||||||
word + "s"
|
word + "s"
|
||||||
@@ -214,7 +203,7 @@
|
|||||||
|
|
||||||
if is_acronym {
|
if is_acronym {
|
||||||
// Use acronym rules
|
// Use acronym rules
|
||||||
let first_char = upper_word.codepoints().slice(0, 1).first()
|
let first_char = upper_word.codepoints().slice(0,1).first()
|
||||||
if acronym_vowels.contains(first_char) {
|
if acronym_vowels.contains(first_char) {
|
||||||
"an"
|
"an"
|
||||||
} else {
|
} else {
|
||||||
@@ -222,17 +211,17 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Non-acronym rules
|
// Non-acronym rules
|
||||||
let first_char = lower_word.codepoints().slice(0, 1).first()
|
let first_char = lower_word.codepoints().slice(0,1).first()
|
||||||
|
|
||||||
// Special cases for words matching a set of known 'silent h' prefixes
|
// Special cases for words matching a set of known 'silent h' prefixes
|
||||||
let silent_h_words = (
|
let silent_h_words = (
|
||||||
"heir", // "air"
|
"heir", // "air"
|
||||||
"herb", // "erb" (in American English)
|
"herb", // "erb" (in American English)
|
||||||
"homage", // "oh-mij" or "ah-mij"
|
"homage", // "oh-mij" or "ah-mij"
|
||||||
"honest", // "on-est"
|
"honest", // "on-est"
|
||||||
"honor", // "on-or" (American English)
|
"honor", // "on-or" (American English)
|
||||||
"honour", // "on-our" (British English)
|
"honour", // "on-our" (British English)
|
||||||
"hour", // "our"
|
"hour", // "our"
|
||||||
)
|
)
|
||||||
if silent_h_words.any(w => lower_word.starts-with(w)) {
|
if silent_h_words.any(w => lower_word.starts-with(w)) {
|
||||||
return "an"
|
return "an"
|
||||||
@@ -246,15 +235,15 @@
|
|||||||
// Words starting with 'u', that get the 'yoo' sound
|
// Words starting with 'u', that get the 'yoo' sound
|
||||||
if first_char == "u" {
|
if first_char == "u" {
|
||||||
let yoo_sounds = (
|
let yoo_sounds = (
|
||||||
"ubi", // ubiquitous
|
"ubi", // ubiquitous
|
||||||
"uni", // unicycle, uniform, universe, university, unilateral, unique, union, etc.
|
"uni", // unicycle, uniform, universe, university, unilateral, unique, union, etc.
|
||||||
"usa", // usage, usability
|
"usa", // usage, usability
|
||||||
"use", // use, useful, useless
|
"use", // use, useful, useless
|
||||||
"usu", // usual, usually
|
"usu", // usual, usually
|
||||||
"usur", // usurp
|
"usur", // usurp
|
||||||
"ute", // utensil, uterus
|
"ute", // utensil, uterus
|
||||||
"uti", // utility, utilize, utilization
|
"uti", // utility, utilize, utilization
|
||||||
"uto", // utopia, utopian
|
"uto", // utopia, utopian
|
||||||
)
|
)
|
||||||
if yoo_sounds.any(w => lower_word.starts-with(w)) {
|
if yoo_sounds.any(w => lower_word.starts-with(w)) {
|
||||||
return "a"
|
return "a"
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 490 KiB |
@@ -6,11 +6,10 @@
|
|||||||
tps: (
|
tps: (
|
||||||
short: "TPS",
|
short: "TPS",
|
||||||
long: "test procedure specification",
|
long: "test procedure specification",
|
||||||
description: "A document on how to run all the test procedures",
|
description: "A document on how to run all the test procedures"),
|
||||||
),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
#show: init-glossary.with(myGlossary, show-term: body => [#emph(body)])
|
#show: init-glossary.with(myGlossary, show-term: (body) => [#emph(body)])
|
||||||
|
|
||||||
#set heading(numbering: "1.1")
|
#set heading(numbering: "1.1")
|
||||||
#set page(numbering: "1")
|
#set page(numbering: "1")
|
||||||
@@ -41,51 +40,18 @@ Now make sure I get your @tps:short reports by 2pm!
|
|||||||
|
|
||||||
== Using conflicting modifiers (short, long, both)
|
== Using conflicting modifiers (short, long, both)
|
||||||
|
|
||||||
These modifiers are semantically mutually exclusive. When multiple are used,
|
These modifiers are semantically mutually exclusive, by they can be combined
|
||||||
`glossy` throws an error to the compiler, explaining the problem.
|
syntactically. When multiple are used, `glossy` tries to make a smart choice on
|
||||||
|
which one to display.
|
||||||
#import "/src/gloss.typ": __default-format-term, __gls
|
|
||||||
#let manual-gls(key, mods) = __gls(
|
|
||||||
key,
|
|
||||||
modes-modifiers: mods,
|
|
||||||
format-term: __default-format-term,
|
|
||||||
show-term: body => [#strong(body)],
|
|
||||||
term-links: false,
|
|
||||||
display-text: none,
|
|
||||||
)
|
|
||||||
#assert-panic(manual-gls.with("tps", ("short", "long")))
|
|
||||||
#let msg-short-long = "panicked with: \"Cannot mix modes \", (\"short\", \"long\"), \", pick one.\""
|
|
||||||
#let msg-short-both = "panicked with: \"Cannot mix modes \", (\"short\", \"both\"), \", pick one.\""
|
|
||||||
#let msg-long-both = "panicked with: \"Cannot mix modes \", (\"long\", \"both\"), \", pick one.\""
|
|
||||||
#let msg-short-long-both = "panicked with: \"Cannot mix modes \", (\"short\", \"long\", \"both\"), \", pick one.\""
|
|
||||||
|
|
||||||
#table(
|
#table(
|
||||||
columns: 2,
|
columns: 2,
|
||||||
table.header([*Input*], [*Error*]),
|
table.header([*Input*], [*Output*]),
|
||||||
|
|
||||||
[`@tps:short:long` ],
|
[`@tps:short:long` ], [@tps:short:long],
|
||||||
[#assert.eq(
|
[`@tps:short:both` ], [@tps:short:both],
|
||||||
catch(manual-gls.with("tps", ("short", "long"))),
|
[`@tps:long:both` ], [@tps:long:both],
|
||||||
msg-short-long,
|
[`@tps:short:long:both`], [@tps:short:long:both],
|
||||||
)#msg-short-long],
|
|
||||||
|
|
||||||
[`@tps:short:both` ],
|
|
||||||
[#assert.eq(
|
|
||||||
catch(manual-gls.with("tps", ("short", "both"))),
|
|
||||||
msg-short-both,
|
|
||||||
)#msg-short-both],
|
|
||||||
|
|
||||||
[`@tps:long:both` ],
|
|
||||||
[#assert.eq(
|
|
||||||
catch(manual-gls.with("tps", ("long", "both"))),
|
|
||||||
msg-long-both,
|
|
||||||
)#msg-long-both],
|
|
||||||
|
|
||||||
[`@tps:short:long:both`],
|
|
||||||
[#assert.eq(
|
|
||||||
catch(manual-gls.with("tps", ("short", "long", "both"))),
|
|
||||||
msg-short-long-both,
|
|
||||||
)#msg-short-long-both],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
#let my-theme = (
|
#let my-theme = (
|
||||||
@@ -111,10 +77,12 @@ These modifiers are semantically mutually exclusive. When multiple are used,
|
|||||||
block(
|
block(
|
||||||
grid(
|
grid(
|
||||||
columns: (auto, 1fr, auto),
|
columns: (auto, 1fr, auto),
|
||||||
output, repeat([#h(0.25em) . #h(0.25em)]), entry.pages.join(", "),
|
output,
|
||||||
),
|
repeat([#h(0.25em) . #h(0.25em)]),
|
||||||
|
entry.pages,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
},
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
#glossary(theme: my-theme)
|
#glossary(theme: my-theme)
|
||||||
|
Before Width: | Height: | Size: 187 KiB After Width: | Height: | Size: 882 KiB |
@@ -7,23 +7,20 @@
|
|||||||
short: "HTML",
|
short: "HTML",
|
||||||
long: "Hypertext Markup Language",
|
long: "Hypertext Markup Language",
|
||||||
description: "A standard language for creating web pages",
|
description: "A standard language for creating web pages",
|
||||||
group: "Web",
|
group: "Web"),
|
||||||
),
|
|
||||||
css: (
|
css: (
|
||||||
short: "CSS",
|
short: "CSS",
|
||||||
long: "Cascading Style Sheets",
|
long: "Cascading Style Sheets",
|
||||||
description: "A language used for describing the presentation of a document",
|
description: "A language used for describing the presentation of a document",
|
||||||
group: "Web",
|
group: "Web"),
|
||||||
),
|
|
||||||
tps: (
|
tps: (
|
||||||
short: "TPS",
|
short: "TPS",
|
||||||
long: "test procedure specification",
|
long: "test procedure specification",
|
||||||
description: "A document on how to run all the test procedures",
|
description: "A document on how to run all the test procedures"),
|
||||||
),
|
unused: "Unused term, which shouldn't print in the glossary."
|
||||||
unused: "Unused term, which shouldn't print in the glossary.",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
#show: init-glossary.with(myGlossary, show-term: body => [#emph(body)])
|
#show: init-glossary.with(myGlossary, show-term: (body) => [#emph(body)])
|
||||||
|
|
||||||
#set heading(numbering: "1.1")
|
#set heading(numbering: "1.1")
|
||||||
#set page(height: auto, width: 6.5in, margin: 1em, numbering: "1")
|
#set page(height: auto, width: 6.5in, margin: 1em, numbering: "1")
|
||||||
@@ -81,51 +78,18 @@ Articles are incompatible with the `pl` (plural) modifier.
|
|||||||
|
|
||||||
== Using conflicting modifiers (short, long, both)
|
== Using conflicting modifiers (short, long, both)
|
||||||
|
|
||||||
These modifiers are semantically mutually exclusive. When multiple are used,
|
These modifiers are semantically mutually exclusive, by they can be combined
|
||||||
`glossy` throws an error to the compiler, explaining the problem.
|
syntactically. When multiple are used, `glossy` tries to make a smart choice on
|
||||||
|
which one to display.
|
||||||
#import "/src/gloss.typ": __default-format-term, __gls
|
|
||||||
#let manual-gls(key, mods) = __gls(
|
|
||||||
key,
|
|
||||||
modes-modifiers: mods,
|
|
||||||
format-term: __default-format-term,
|
|
||||||
show-term: body => [#strong(body)],
|
|
||||||
term-links: false,
|
|
||||||
display-text: none,
|
|
||||||
)
|
|
||||||
#assert-panic(manual-gls.with("tps", ("short", "long")))
|
|
||||||
#let msg-short-long = "panicked with: \"Cannot mix modes \", (\"short\", \"long\"), \", pick one.\""
|
|
||||||
#let msg-short-both = "panicked with: \"Cannot mix modes \", (\"short\", \"both\"), \", pick one.\""
|
|
||||||
#let msg-long-both = "panicked with: \"Cannot mix modes \", (\"long\", \"both\"), \", pick one.\""
|
|
||||||
#let msg-short-long-both = "panicked with: \"Cannot mix modes \", (\"short\", \"long\", \"both\"), \", pick one.\""
|
|
||||||
|
|
||||||
#table(
|
#table(
|
||||||
columns: 2,
|
columns: 2,
|
||||||
table.header([*Input*], [*Error*]),
|
table.header([*Input*], [*Output*]),
|
||||||
|
|
||||||
[`@tps:short:long` ],
|
[`@tps:short:long` ], [@tps:short:long],
|
||||||
[#assert.eq(
|
[`@tps:short:both` ], [@tps:short:both],
|
||||||
catch(manual-gls.with("tps", ("short", "long"))),
|
[`@tps:long:both` ], [@tps:long:both],
|
||||||
msg-short-long,
|
[`@tps:short:long:both`], [@tps:short:long:both],
|
||||||
)#msg-short-long],
|
|
||||||
|
|
||||||
[`@tps:short:both` ],
|
|
||||||
[#assert.eq(
|
|
||||||
catch(manual-gls.with("tps", ("short", "both"))),
|
|
||||||
msg-short-both,
|
|
||||||
)#msg-short-both],
|
|
||||||
|
|
||||||
[`@tps:long:both` ],
|
|
||||||
[#assert.eq(
|
|
||||||
catch(manual-gls.with("tps", ("long", "both"))),
|
|
||||||
msg-long-both,
|
|
||||||
)#msg-long-both],
|
|
||||||
|
|
||||||
[`@tps:short:long:both`],
|
|
||||||
[#assert.eq(
|
|
||||||
catch(manual-gls.with("tps", ("short", "long", "both"))),
|
|
||||||
msg-short-long-both,
|
|
||||||
)#msg-short-long-both],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
#let my-theme = (
|
#let my-theme = (
|
||||||
@@ -151,20 +115,14 @@ These modifiers are semantically mutually exclusive. When multiple are used,
|
|||||||
block(
|
block(
|
||||||
grid(
|
grid(
|
||||||
columns: (auto, 1fr, auto),
|
columns: (auto, 1fr, auto),
|
||||||
output, repeat([#h(0.25em) . #h(0.25em)]), entry.pages.join(", "),
|
output,
|
||||||
),
|
repeat([#h(0.25em) . #h(0.25em)]),
|
||||||
|
entry.pages,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
},
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
#glossary(theme: my-theme)
|
#glossary(theme: my-theme)
|
||||||
#glossary(
|
#glossary(title: "Glossary with just empty group", groups: ("",), theme: theme-basic)
|
||||||
title: "Glossary with just empty group",
|
#glossary(title: "Glossary with just Web group", groups: ("Web",), theme: theme-compact)
|
||||||
groups: ("",),
|
|
||||||
theme: theme-basic,
|
|
||||||
)
|
|
||||||
#glossary(
|
|
||||||
title: "Glossary with just Web group",
|
|
||||||
groups: ("Web",),
|
|
||||||
theme: theme-compact,
|
|
||||||
)
|
|
||||||
@@ -2,274 +2,285 @@
|
|||||||
|
|
||||||
#let tests = (
|
#let tests = (
|
||||||
// Main tests (covers most of English language)
|
// Main tests (covers most of English language)
|
||||||
("Europe", "a"),
|
("Europe","a"),
|
||||||
("European", "a"),
|
("European","a"),
|
||||||
("Hannah", "a"),
|
("Hannah","a"),
|
||||||
("T-shirt", "a"),
|
("T-shirt","a"),
|
||||||
("Xerox", "a"),
|
("Xerox","a"),
|
||||||
("Zebra", "a"),
|
("Zebra","a"),
|
||||||
("aardvark", "an"),
|
("aardvark","an"),
|
||||||
("apple", "an"),
|
("apple","an"),
|
||||||
("boat", "a"),
|
("boat","a"),
|
||||||
("car", "a"),
|
("car","a"),
|
||||||
("cat", "a"),
|
("cat","a"),
|
||||||
("chair", "a"),
|
("chair","a"),
|
||||||
("dog", "a"),
|
("dog","a"),
|
||||||
("egg", "an"),
|
("egg","an"),
|
||||||
("elephant", "an"),
|
("elephant","an"),
|
||||||
("emu", "an"),
|
("emu","an"),
|
||||||
("eucalyptus", "a"),
|
("eucalyptus","a"),
|
||||||
("eulogy", "a"),
|
("eulogy","a"),
|
||||||
("euphemism", "a"),
|
("euphemism","a"),
|
||||||
("exhausted", "an"),
|
("exhausted","an"),
|
||||||
("ghost", "a"),
|
("ghost","a"),
|
||||||
("hat", "a"),
|
("hat","a"),
|
||||||
("heir", "an"),
|
("heir","an"),
|
||||||
("heiress", "an"),
|
("heiress","an"),
|
||||||
("herb", "an"),
|
("herb","an"),
|
||||||
("herbal", "an"),
|
("herbal","an"),
|
||||||
("historic", "a"),
|
("historic","a"),
|
||||||
("history", "a"),
|
("history","a"),
|
||||||
("homage", "an"),
|
("homage","an"),
|
||||||
("honest", "an"),
|
("honest","an"),
|
||||||
("honestly", "an"),
|
("honestly","an"),
|
||||||
("honor", "an"),
|
("honor","an"),
|
||||||
("honorary", "an"),
|
("honorary","an"),
|
||||||
("honour", "an"),
|
("honour","an"),
|
||||||
("horse", "a"),
|
("horse","a"),
|
||||||
("hour", "an"),
|
("hour","an"),
|
||||||
("hourglass", "an"),
|
("hourglass","an"),
|
||||||
("house", "a"),
|
("house","a"),
|
||||||
("iris", "an"),
|
("iris","an"),
|
||||||
("orange", "an"),
|
("orange","an"),
|
||||||
("owl", "an"),
|
("owl","an"),
|
||||||
("table", "a"),
|
("table","a"),
|
||||||
("ugly", "an"),
|
("ugly","an"),
|
||||||
("umbrella", "an"),
|
("umbrella","an"),
|
||||||
("umpire", "an"),
|
("umpire","an"),
|
||||||
("unicorn", "a"),
|
("unicorn","a"),
|
||||||
("unique", "a"),
|
("unique","a"),
|
||||||
("university", "a"),
|
("university","a"),
|
||||||
("urn", "an"),
|
("urn","an"),
|
||||||
("usage", "a"),
|
("usage","a"),
|
||||||
("user", "a"),
|
("user","a"),
|
||||||
("utensil", "a"),
|
("utensil","a"),
|
||||||
|
|
||||||
// Acronym tests
|
// Acronym tests
|
||||||
("ASCII", "an"),
|
("ASCII","an"),
|
||||||
("CFO", "a"),
|
("CFO","a"),
|
||||||
("F.A.Q.", "an"),
|
("F.A.Q.","an"),
|
||||||
("FBI", "an"),
|
("FBI","an"),
|
||||||
("GIF", "a"),
|
("GIF","a"),
|
||||||
("HIV", "an"),
|
("HIV","an"),
|
||||||
("JPEG", "a"),
|
("JPEG","a"),
|
||||||
("LED", "an"),
|
("LED","an"),
|
||||||
("MRI", "an"),
|
("MRI","an"),
|
||||||
("NATO", "an"),
|
("NATO","an"),
|
||||||
("PNG", "a"),
|
("PNG","a"),
|
||||||
("Q&A", "a"),
|
("Q&A","a"),
|
||||||
("RF", "an"),
|
("RF","an"),
|
||||||
("RNG", "an"),
|
("RNG","an"),
|
||||||
("SAS", "an"),
|
("SAS","an"),
|
||||||
("SMS", "an"),
|
("SMS","an"),
|
||||||
("SOS", "an"),
|
("SOS","an"),
|
||||||
("SQL", "an"),
|
("SQL","an"),
|
||||||
("UFO", "a"),
|
("UFO","a"),
|
||||||
("URL", "a"),
|
("URL","a"),
|
||||||
("VCR", "a"),
|
("VCR","a"),
|
||||||
("WWW", "a"),
|
("WWW","a"),
|
||||||
("X.Y.Z.", "an"),
|
("X.Y.Z.","an"),
|
||||||
("YAML", "a"),
|
("YAML","a"),
|
||||||
|
|
||||||
// Extra tests (courtesy of LLM)
|
// Extra tests (courtesy of LLM)
|
||||||
|
|
||||||
// Common English words starting with vowels
|
// Common English words starting with vowels
|
||||||
("idea", "an"),
|
("idea","an"),
|
||||||
("island", "an"),
|
("island","an"),
|
||||||
("offer", "an"),
|
("offer","an"),
|
||||||
("option", "an"),
|
("option","an"),
|
||||||
("operation", "an"),
|
("operation","an"),
|
||||||
("appletree", "an"),
|
("appletree","an"),
|
||||||
("iguana", "an"),
|
("iguana","an"),
|
||||||
("octopus", "an"),
|
("octopus","an"),
|
||||||
("atom", "an"),
|
("atom","an"),
|
||||||
("item", "an"),
|
("item","an"),
|
||||||
|
|
||||||
// Words starting with vowel but "yoo" sound (thus 'a')
|
// Words starting with vowel but "yoo" sound (thus 'a')
|
||||||
("universe", "a"),
|
("universe","a"),
|
||||||
("unicycle", "a"),
|
("unicycle","a"),
|
||||||
("uniform", "a"),
|
("uniform","a"),
|
||||||
("union", "a"),
|
("union","a"),
|
||||||
("united", "a"),
|
("united","a"),
|
||||||
("unique", "a"), // already tested, reaffirmed
|
("unique","a"), // already tested, reaffirmed
|
||||||
("usual", "a"),
|
("usual","a"),
|
||||||
("useful", "a"),
|
("useful","a"),
|
||||||
("utility", "a"),
|
("utility","a"),
|
||||||
("utopia", "a"),
|
("utopia","a"),
|
||||||
|
|
||||||
// More common vowel words with a/an
|
// More common vowel words with a/an
|
||||||
("umbrella", "an"), // repeated but reaffirming
|
("umbrella","an"), // repeated but reaffirming
|
||||||
("eggplant", "an"),
|
("eggplant","an"),
|
||||||
("insect", "an"),
|
("insect","an"),
|
||||||
("eleven", "an"),
|
("eleven","an"),
|
||||||
("olive", "an"),
|
("olive","an"),
|
||||||
("impulse", "an"),
|
("impulse","an"),
|
||||||
("ox", "an"),
|
("ox","an"),
|
||||||
("aroma", "an"),
|
("aroma","an"),
|
||||||
("ear", "an"),
|
("ear","an"),
|
||||||
("ocean", "an"),
|
("ocean","an"),
|
||||||
|
|
||||||
// Words starting with 'h' but pronounced, so 'a'
|
// Words starting with 'h' but pronounced, so 'a'
|
||||||
("house", "a"), // repeated for emphasis
|
("house","a"), // repeated for emphasis
|
||||||
("hammer", "a"),
|
("hammer","a"),
|
||||||
("helmet", "a"),
|
("helmet","a"),
|
||||||
("history", "a"), // repeated
|
("history","a"), // repeated
|
||||||
("hero", "a"),
|
("hero","a"),
|
||||||
("hill", "a"),
|
("hill","a"),
|
||||||
("hobby", "a"),
|
("hobby","a"),
|
||||||
("holiday", "a"),
|
("holiday","a"),
|
||||||
("harmony", "a"),
|
("harmony","a"),
|
||||||
("hover", "a"),
|
("hover","a"),
|
||||||
|
|
||||||
// More silent 'h' words (already in set, but variations)
|
// More silent 'h' words (already in set, but variations)
|
||||||
("honorific", "an"),
|
("honorific","an"),
|
||||||
("honorarium", "an"),
|
("honorarium","an"),
|
||||||
("honesties", "an"),
|
("honesties","an"),
|
||||||
("hourly", "an"),
|
("hourly","an"),
|
||||||
("heirloom", "an"),
|
("heirloom","an"),
|
||||||
|
|
||||||
// Words starting with 'e' + 'u' combo with "yoo" sound
|
// Words starting with 'e' + 'u' combo with "yoo" sound
|
||||||
("Europe", "a"), // repeated
|
("Europe","a"), // repeated
|
||||||
("European", "a"), // repeated
|
("European","a"), // repeated
|
||||||
("euphoric", "a"),
|
("euphoric","a"),
|
||||||
("eureka", "a"),
|
("eureka","a"),
|
||||||
("euphemistic", "a"),
|
("euphemistic","a"),
|
||||||
("euphonious", "a"),
|
("euphonious","a"),
|
||||||
("eucalyptus", "a"), // repeated
|
("eucalyptus","a"), // repeated
|
||||||
("euthanasia", "a"),
|
("euthanasia","a"),
|
||||||
("eugenics", "a"),
|
("eugenics","a"),
|
||||||
("Eurasia", "a"),
|
("Eurasia","a"),
|
||||||
|
|
||||||
// Common consonant-start words
|
// Common consonant-start words
|
||||||
("book", "a"),
|
("book","a"),
|
||||||
("pen", "a"),
|
("pen","a"),
|
||||||
("fork", "a"),
|
("fork","a"),
|
||||||
("spoon", "a"),
|
("spoon","a"),
|
||||||
("knife", "a"),
|
("knife","a"),
|
||||||
("ball", "a"),
|
("ball","a"),
|
||||||
("tree", "a"),
|
("tree","a"),
|
||||||
("river", "a"),
|
("river","a"),
|
||||||
("mountain", "a"),
|
("mountain","a"),
|
||||||
("cloud", "a"),
|
("cloud","a"),
|
||||||
|
|
||||||
// More vowel-start words
|
// More vowel-start words
|
||||||
("ostrich", "an"),
|
("ostrich","an"),
|
||||||
("amphibian", "an"),
|
("amphibian","an"),
|
||||||
("eleven", "an"), // repeated
|
("eleven","an"), // repeated
|
||||||
("issue", "an"),
|
("issue","an"),
|
||||||
("incense", "an"),
|
("incense","an"),
|
||||||
("antenna", "an"),
|
("antenna","an"),
|
||||||
("echo", "an"),
|
("echo","an"),
|
||||||
("aisle", "an"),
|
("aisle","an"),
|
||||||
("oracle", "an"),
|
("oracle","an"),
|
||||||
("overcoat", "an"),
|
("overcoat","an"),
|
||||||
|
|
||||||
// More acronym/initialism tests:
|
// More acronym/initialism tests:
|
||||||
("ATM", "an"), // A = 'ay'
|
("ATM","an"), // A = 'ay'
|
||||||
("EPA", "an"), // E = 'ee'
|
("EPA","an"), // E = 'ee'
|
||||||
("FAQ", "an"), // F = 'eff', repeated as F.A.Q.
|
("FAQ","an"), // F = 'eff', repeated as F.A.Q.
|
||||||
("HTML", "an"), // H = 'aitch'
|
("HTML","an"), // H = 'aitch'
|
||||||
("IBM", "an"), // I = 'eye'
|
("IBM","an"), // I = 'eye'
|
||||||
("LAN", "an"), // L = 'el'
|
("LAN","an"), // L = 'el'
|
||||||
("NFL", "an"), // N = 'en'
|
("NFL","an"), // N = 'en'
|
||||||
("OSHA", "an"), // O = 'oh'
|
("OSHA","an"), // O = 'oh'
|
||||||
("RAM", "an"), // R = 'ar'
|
("RAM","an"), // R = 'ar'
|
||||||
("SMS", "an"), // repeated, S = 'ess'
|
("SMS","an"), // repeated, S = 'ess'
|
||||||
|
|
||||||
// Acronyms starting with consonant sound letters
|
// Acronyms starting with consonant sound letters
|
||||||
("GIF", "a"), // G = 'jee', repeated
|
("GIF","a"), // G = 'jee', repeated
|
||||||
("CFO", "a"), // C = 'see', repeated (consonant sound 's')
|
("CFO","a"), // C = 'see', repeated (consonant sound 's')
|
||||||
("CEO", "a"), // C = 'see'
|
("CEO","a"), // C = 'see'
|
||||||
("DNA", "a"), // D = 'dee' starts with 'd' consonant sound
|
("DNA","a"), // D = 'dee' starts with 'd' consonant sound
|
||||||
("PGA", "a"), // P = 'pee' starts with 'p' consonant sound
|
("PGA","a"), // P = 'pee' starts with 'p' consonant sound
|
||||||
("QVC", "a"), // Q = 'kyoo' starts with 'k' consonant sound
|
("QVC","a"), // Q = 'kyoo' starts with 'k' consonant sound
|
||||||
("TNT", "a"), // T = 'tee' starts with 't' consonant sound
|
("TNT","a"), // T = 'tee' starts with 't' consonant sound
|
||||||
("UPS", "a"), // U = 'yoo' sound, hence 'a'
|
("UPS","a"), // U = 'yoo' sound, hence 'a'
|
||||||
("VIP", "a"), // V = 'vee' starts with 'v' consonant sound
|
("VIP","a"), // V = 'vee' starts with 'v' consonant sound
|
||||||
("WIPO", "a"), // W = 'double-u' starts with 'd' consonant sound
|
("WIPO","a"), // W = 'double-u' starts with 'd' consonant sound
|
||||||
|
|
||||||
// More tricky 'u' words with 'yoo' sound for 'a'
|
// More tricky 'u' words with 'yoo' sound for 'a'
|
||||||
("unify", "a"),
|
("unify","a"),
|
||||||
("unilateral", "a"),
|
("unilateral","a"),
|
||||||
("ubiquitous", "a"), // 'yoo-bik...'
|
("ubiquitous","a"), // 'yoo-bik...'
|
||||||
("usurp", "a"),
|
("usurp","a"),
|
||||||
("usuary", "a"), // 'yoo-zhoo-ary' (rare, but treat like usual)
|
("usuary","a"), // 'yoo-zhoo-ary' (rare, but treat like usual)
|
||||||
("uterus", "a"), // 'yoo-terus'
|
("uterus","a"), // 'yoo-terus'
|
||||||
("usher", "an"), // 'uh-sher' vowel sound
|
("usher","an"), // 'uh-sher' vowel sound
|
||||||
("ugly", "an"), // repeated, 'uh-glee'
|
("ugly","an"), // repeated, 'uh-glee'
|
||||||
("upper", "an"), // 'uh-pur' (vowel sound but actually 'uh' sound = 'an'? Actually "upper" starts with a simple vowel sound 'uh', so should it be 'an'? It's commonly "an upper hand".
|
("upper","an"), // 'uh-pur' (vowel sound but actually 'uh' sound = 'an'? Actually "upper" starts with a simple vowel sound 'uh', so should it be 'an'? It's commonly "an upper hand".
|
||||||
("update", "an"), // 'up-date' starts with 'uh' vowel sound → 'an update' normally. Actually we say "an update" commonly. Correcting to 'an':
|
("update","an"), // 'up-date' starts with 'uh' vowel sound → 'an update' normally. Actually we say "an update" commonly. Correcting to 'an':
|
||||||
|
|
||||||
// Words starting with 'u' that actually take "an"
|
// Words starting with 'u' that actually take "an"
|
||||||
// (because they start with a vowel sound 'uh'):
|
// (because they start with a vowel sound 'uh'):
|
||||||
("under", "an"),
|
("under","an"),
|
||||||
("understand", "an"),
|
("understand","an"),
|
||||||
("unusual", "an"),
|
("unusual","an"),
|
||||||
("unreal", "an"),
|
("unreal","an"),
|
||||||
("unemployed", "an"),
|
("unemployed","an"),
|
||||||
("unequal", "an"),
|
("unequal","an"),
|
||||||
("unopened", "an"),
|
("unopened","an"),
|
||||||
("unarmed", "an"),
|
("unarmed","an"),
|
||||||
("uneasy", "an"),
|
("uneasy","an"),
|
||||||
("united", "a"), // 'yoo-nited' is 'a united front'
|
("united","a"), // 'yoo-nited' is 'a united front'
|
||||||
("universal", "a"),
|
("universal","a"),
|
||||||
("umbrella", "an"), // repeated
|
("umbrella","an"), // repeated
|
||||||
("upset", "an"), // 'uh-pset' vowel start
|
("upset","an"), // 'uh-pset' vowel start
|
||||||
|
|
||||||
// More vowel words to ensure coverage:
|
// More vowel words to ensure coverage:
|
||||||
("animal", "an"),
|
("animal","an"),
|
||||||
("image", "an"),
|
("image","an"),
|
||||||
("order", "an"),
|
("order","an"),
|
||||||
("arrow", "an"),
|
("arrow","an"),
|
||||||
("ace", "an"),
|
("ace","an"),
|
||||||
("acre", "an"),
|
("acre","an"),
|
||||||
("agent", "an"),
|
("agent","an"),
|
||||||
("artist", "an"),
|
("artist","an"),
|
||||||
("idea", "an"), // repeated
|
("idea","an"), // repeated
|
||||||
("aim", "an"),
|
("aim","an"),
|
||||||
("item", "an"), // repeated
|
("item","an"), // repeated
|
||||||
("isotope", "an"),
|
("isotope","an"),
|
||||||
("opera", "an"),
|
("opera","an"),
|
||||||
|
|
||||||
// Words starting with vowels but pronounced with consonant sound 'y' → 'a'
|
// Words starting with vowels but pronounced with consonant sound 'y' → 'a'
|
||||||
("euphemistic", "a"), // repeated
|
("euphemistic","a"), // repeated
|
||||||
("euphoric", "a"),
|
("euphoric","a"),
|
||||||
("eulogy", "a"), // repeated
|
("eulogy","a"), // repeated
|
||||||
("Europe", "a"), // repeated
|
("Europe","a"), // repeated
|
||||||
("European", "a"), // repeated
|
("European","a"), // repeated
|
||||||
("eugenics", "a"), // repeated
|
("eugenics","a"), // repeated
|
||||||
("euphemism", "a"), // repeated
|
("euphemism","a"), // repeated
|
||||||
("eureka", "a"), // repeated
|
("eureka","a"), // repeated
|
||||||
("euphonious", "a"),
|
("euphonious","a"),
|
||||||
("Eurasia", "a"),
|
("Eurasia","a"),
|
||||||
|
|
||||||
// Common consonant-start words:
|
// Common consonant-start words:
|
||||||
("milk", "a"),
|
("milk","a"),
|
||||||
("road", "a"),
|
("road","a"),
|
||||||
("stone", "a"),
|
("stone","a"),
|
||||||
("book", "a"), // repeated
|
("book","a"), // repeated
|
||||||
("pen", "a"), // repeated
|
("pen","a"), // repeated
|
||||||
("fork", "a"), // repeated
|
("fork","a"), // repeated
|
||||||
("spoon", "a"), // repeated
|
("spoon","a"), // repeated
|
||||||
("knife", "a"), // 'knife' actually starts with /n/ sound because 'k' is silent. "a knife" or "an knife"? It's "a knife" (starts with 'n' consonant sound?), actually 'kn' in 'knife' is silent, so 'knife' is pronounced 'nife' with a consonant sound 'n', so "a knife" is correct.
|
("knife","a"), // 'knife' actually starts with /n/ sound because 'k' is silent. "a knife" or "an knife"? It's "a knife" (starts with 'n' consonant sound?), actually 'kn' in 'knife' is silent, so 'knife' is pronounced 'nife' with a consonant sound 'n', so "a knife" is correct.
|
||||||
("glass", "a"),
|
("glass","a"),
|
||||||
("window", "a"),
|
("window","a"),
|
||||||
|
|
||||||
// Final checks with tricky silent letters:
|
// Final checks with tricky silent letters:
|
||||||
("gnome", "a"), // 'g' silent, pronounced 'nome' with 'n' consonant sound → 'a gnome'
|
("gnome","a"), // 'g' silent, pronounced 'nome' with 'n' consonant sound → 'a gnome'
|
||||||
("gnat", "a"), // 'nat' consonant sound → 'a gnat'
|
("gnat","a"), // 'nat' consonant sound → 'a gnat'
|
||||||
("xylophone", "a"), // 'zylophone' → 'z' consonant sound → 'a xylophone'
|
("xylophone","a"), // 'zylophone' → 'z' consonant sound → 'a xylophone'
|
||||||
("xenon", "a"), // 'zee-non' consonant sound 'z' → 'a xenon'
|
("xenon","a"), // 'zee-non' consonant sound 'z' → 'a xenon'
|
||||||
("honorific", "an"), // repeated but reaffirming
|
("honorific","an"), // repeated but reaffirming
|
||||||
("hourly", "an"), // repeated but reaffirming
|
("hourly","an"), // repeated but reaffirming
|
||||||
("honorably", "an"),
|
("honorably","an"),
|
||||||
("honorifics", "an"),
|
("honorifics","an"),
|
||||||
("honors", "an"),
|
("honors","an"),
|
||||||
)
|
)
|
||||||
|
|
||||||
#for (word, article) in tests {
|
#for (word, article) in tests {
|
||||||
let chosen = __determine_article(word)
|
let chosen = __determine_article(word)
|
||||||
if chosen != article {
|
if chosen != article {
|
||||||
panic(
|
panic("bad choice! word: " + word + ", article: " + article + ", chosen: " + chosen)
|
||||||
"bad choice! word: "
|
|
||||||
+ word
|
|
||||||
+ ", article: "
|
|
||||||
+ article
|
|
||||||
+ ", chosen: "
|
|
||||||
+ chosen,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,24 +5,20 @@
|
|||||||
short: "HTML",
|
short: "HTML",
|
||||||
long: "Hypertext Markup Language",
|
long: "Hypertext Markup Language",
|
||||||
description: "A standard language for creating web pages",
|
description: "A standard language for creating web pages",
|
||||||
group: "Web",
|
group: "Web"),
|
||||||
),
|
|
||||||
css: (
|
css: (
|
||||||
short: "CSS",
|
short: "CSS",
|
||||||
long: "Cascading Style Sheets",
|
long: "Cascading Style Sheets",
|
||||||
description: "A language used for describing the presentation of a document",
|
description: "A language used for describing the presentation of a document",
|
||||||
group: "Web",
|
group: "Web"),
|
||||||
),
|
|
||||||
tps: (
|
tps: (
|
||||||
short: "TPS",
|
short: "TPS",
|
||||||
long: "test procedure specification",
|
long: "test procedure specification",
|
||||||
description: "A document on how to run all the test procedures",
|
description: "A document on how to run all the test procedures"),
|
||||||
),
|
|
||||||
concise: "Concise syntax!",
|
concise: "Concise syntax!",
|
||||||
shortonly: (
|
shortonly: (
|
||||||
short: "shortonly!!!",
|
short: "shortonly!!!"),
|
||||||
),
|
unused: "Unused term, which shouldn't print in the glossary."
|
||||||
unused: "Unused term, which shouldn't print in the glossary.",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
#set page(width: 6.5in, height: auto, margin: 1em)
|
#set page(width: 6.5in, height: auto, margin: 1em)
|
||||||
@@ -30,21 +26,23 @@
|
|||||||
#let test-content = {
|
#let test-content = {
|
||||||
table(
|
table(
|
||||||
columns: 3,
|
columns: 3,
|
||||||
table.header([`short`], [`long`], [`both`]),
|
table.header(
|
||||||
|
[`short`], [`long`], [`both`],
|
||||||
|
),
|
||||||
|
|
||||||
[@html:short], [@html:long], [@html:both],
|
[@html:short], [@html:long], [@html:both],
|
||||||
[@css:short], [@css:long], [@css:both],
|
[@css:short], [@css:long], [@css:both],
|
||||||
[@tps:short], [@tps:long], [@tps:both:nouse],
|
[@tps:short], [@tps:long], [@tps:both],
|
||||||
[@concise:short], [@concise:long], [@concise:both],
|
[@concise:short], [@concise:long], [@concise:both],
|
||||||
[@shortonly:short], [@shortonly:long], [@shortonly:both],
|
[@shortonly:short], [@shortonly:long], [@shortonly:both],
|
||||||
|
|
||||||
table.hline(stroke: 2pt),
|
table.hline(stroke: 2pt),
|
||||||
|
|
||||||
[@html:short:cap], [@html:long:cap], [@html:both:cap],
|
[@html:short:cap], [@html:long:cap], [@html:both:cap],
|
||||||
[@a:css:short], [@a:css:long], [@a:css:both],
|
[@a:css:short], [@a:css:long], [@a:css:both],
|
||||||
[@tps:short:pl], [@tps:long:pl], [@tps:both:nouse:pl],
|
[@tps:short:pl], [@tps:long:pl], [@tps:both:pl],
|
||||||
[@concise:a:cap:short], [@concise:a:cap:long], [@concise:a:cap:both],
|
[@concise:a:cap:short], [@concise:a:cap:long], [@concise:a:cap:both],
|
||||||
[@an:shortonly:short], [@an:shortonly:long], [@an:shortonly:both],
|
[@an:shortonly:short], [@an:shortonly:long], [@an:shortonly:both],
|
||||||
)
|
)
|
||||||
|
|
||||||
[@a:tps:cap is @tps:def.]
|
[@a:tps:cap is @tps:def.]
|
||||||
@@ -56,7 +54,7 @@
|
|||||||
if mode == "short" {
|
if mode == "short" {
|
||||||
short-form
|
short-form
|
||||||
} else if mode == "long" {
|
} else if mode == "long" {
|
||||||
long-form
|
long-form
|
||||||
} else {
|
} else {
|
||||||
long-form + " (" + short-form + ")"
|
long-form + " (" + short-form + ")"
|
||||||
}
|
}
|
||||||
@@ -81,7 +79,7 @@
|
|||||||
// ---------------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------------
|
||||||
|
|
||||||
#let format-uppercase-short(mode, short-form, long-form) = {
|
#let format-uppercase-short(mode, short-form, long-form) = {
|
||||||
let short-up = upper(short-form)
|
let short-up = upper(short-form);
|
||||||
if mode == "short" {
|
if mode == "short" {
|
||||||
short-up
|
short-up
|
||||||
} else if mode == "long" {
|
} else if mode == "long" {
|
||||||
@@ -110,8 +108,8 @@
|
|||||||
// ---------------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------------
|
||||||
|
|
||||||
#let format-conditional-separator(mode, short-form, long-form) = {
|
#let format-conditional-separator(mode, short-form, long-form) = {
|
||||||
let separator = if short-form.len() > 4 { " / " } else { ", " }
|
let separator = if short-form.len() > 4 { " / " } else { ", " };
|
||||||
let has_long = long-form != none and long-form != ""
|
let has_long = long-form != none and long-form != "";
|
||||||
|
|
||||||
if mode == "short" {
|
if mode == "short" {
|
||||||
short-form
|
short-form
|
||||||
@@ -126,10 +124,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#init-glossary(
|
#init-glossary(myGlossary, format-term: format-conditional-separator)[#test-content]
|
||||||
myGlossary,
|
|
||||||
format-term: format-conditional-separator,
|
|
||||||
)[#test-content]
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------------
|
||||||
// 1. Braces and Labels
|
// 1. Braces and Labels
|
||||||
@@ -150,9 +145,7 @@
|
|||||||
// 2. Mode-Based Prefix
|
// 2. Mode-Based Prefix
|
||||||
// Idea: Add a prefix indicating the mode, and then show the term(s).
|
// Idea: Add a prefix indicating the mode, and then show the term(s).
|
||||||
#let format-mode-prefix(mode, short-form, long-form) = {
|
#let format-mode-prefix(mode, short-form, long-form) = {
|
||||||
let prefix = if mode == "short" { "S:" } else if mode == "long" {
|
let prefix = if mode == "short" { "S:" } else if mode == "long" { "L:" } else { "B:" };
|
||||||
"L:"
|
|
||||||
} else { "B:" }
|
|
||||||
if mode == "short" {
|
if mode == "short" {
|
||||||
prefix + short-form
|
prefix + short-form
|
||||||
} else if mode == "long" {
|
} else if mode == "long" {
|
||||||
@@ -168,7 +161,7 @@
|
|||||||
// 3. Conditional Fallback for Missing Long
|
// 3. Conditional Fallback for Missing Long
|
||||||
// Idea: If no long-form is provided, use the short-form in all cases.
|
// Idea: If no long-form is provided, use the short-form in all cases.
|
||||||
#let format-fallback-long(mode, short-form, long-form) = {
|
#let format-fallback-long(mode, short-form, long-form) = {
|
||||||
let has_long = long-form != none and long-form != ""
|
let has_long = long-form != none and long-form != "";
|
||||||
if mode == "short" {
|
if mode == "short" {
|
||||||
short-form
|
short-form
|
||||||
} else if mode == "long" {
|
} else if mode == "long" {
|
||||||
@@ -200,9 +193,7 @@
|
|||||||
// Idea: In both mode, append the length of each string.
|
// Idea: In both mode, append the length of each string.
|
||||||
#let format-length-info(mode, short-form, long-form) = {
|
#let format-length-info(mode, short-form, long-form) = {
|
||||||
let s_len = str(short-form.len())
|
let s_len = str(short-form.len())
|
||||||
let l_len = if long-form != none and long-form != "" {
|
let l_len = if long-form != none and long-form != "" { str(long-form.len()) } else { "0" }
|
||||||
str(long-form.len())
|
|
||||||
} else { "0" }
|
|
||||||
|
|
||||||
if mode == "short" {
|
if mode == "short" {
|
||||||
short-form + " [len:" + s_len + "]"
|
short-form + " [len:" + s_len + "]"
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 98 KiB |
@@ -1,5 +1,5 @@
|
|||||||
#import "/lib.typ": *
|
#import "/lib.typ": *
|
||||||
#import "@preview/glossarium:0.5.9": *
|
#import "@preview/glossarium:0.5.3": *
|
||||||
|
|
||||||
#set page(height: auto, width: 4.5in)
|
#set page(height: auto, width: 4.5in)
|
||||||
#show link: set text(fill: red)
|
#show link: set text(fill: red)
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
This should be a link, too: @WWW
|
This should be a link, too: @WWW
|
||||||
|
|
||||||
#glossary()
|
#glossary()
|
||||||
],
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
@@ -41,5 +41,5 @@
|
|||||||
This should be a link, too: @ML
|
This should be a link, too: @ML
|
||||||
|
|
||||||
#print-glossary(entry-list)
|
#print-glossary(entry-list)
|
||||||
],
|
]
|
||||||
)
|
)
|
||||||
@@ -12,22 +12,22 @@ Reference: @pbr, @zbuffer
|
|||||||
]
|
]
|
||||||
|
|
||||||
#t("abbreviations") // "string" : str
|
#t("abbreviations") // "string" : str
|
||||||
#t("abbreviations") // ("string") : str
|
#t(("abbreviations")) // ("string") : str
|
||||||
#t(("abbreviations",)) // ("string",) : array(str)
|
#t(("abbreviations",)) // ("string",) : array(str)
|
||||||
#t(("abbreviations", "abbreviations")) // ("string","string",) : array(str)
|
#t(("abbreviations","abbreviations")) // ("string","string",) : array(str)
|
||||||
|
|
||||||
#pagebreak(weak: true)
|
#pagebreak(weak: true)
|
||||||
|
|
||||||
#t("") // empty string should be the empty group
|
#t("") // empty string should be the empty group
|
||||||
#t("") // empty string should be the empty group
|
#t(("")) // empty string should be the empty group
|
||||||
#t(("",)) // empty string should be the empty group
|
#t(("",)) // empty string should be the empty group
|
||||||
#t(("", "")) // empty string should be the empty group
|
#t(("","")) // empty string should be the empty group
|
||||||
|
|
||||||
#pagebreak(weak: true)
|
#pagebreak(weak: true)
|
||||||
|
|
||||||
#t(none) // none should be all groups
|
#t(none) // none should be all groups
|
||||||
#t(none) // none should be all groups
|
#t((none)) // none should be all groups
|
||||||
|
|
||||||
#pagebreak(weak: true)
|
#pagebreak(weak: true)
|
||||||
|
|
||||||
#t(("abbreviations", none)) // try to get both groups
|
#t(("abbreviations",none)) // try to get both groups
|
||||||
@@ -5,20 +5,17 @@
|
|||||||
short: "HTML",
|
short: "HTML",
|
||||||
long: "Hypertext Markup Language",
|
long: "Hypertext Markup Language",
|
||||||
description: "A standard language for creating web pages",
|
description: "A standard language for creating web pages",
|
||||||
group: "Web",
|
group: "Web"),
|
||||||
),
|
|
||||||
css: (
|
css: (
|
||||||
short: "CSS",
|
short: "CSS",
|
||||||
long: "Cascading Style Sheets",
|
long: "Cascading Style Sheets",
|
||||||
description: "A language used for describing the presentation of a document",
|
description: "A language used for describing the presentation of a document",
|
||||||
group: "Web",
|
group: "Web"),
|
||||||
),
|
|
||||||
tps: (
|
tps: (
|
||||||
short: "TPS",
|
short: "TPS",
|
||||||
long: "test procedure specification",
|
long: "test procedure specification",
|
||||||
description: "A document on how to run all the test procedures",
|
description: "A document on how to run all the test procedures"),
|
||||||
),
|
unused: "Unused term, which shouldn't print in the glossary."
|
||||||
unused: "Unused term, which shouldn't print in the glossary.",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
#show: init-glossary.with(myGlossary)
|
#show: init-glossary.with(myGlossary)
|
||||||
@@ -27,9 +24,9 @@
|
|||||||
|
|
||||||
= Hiding terms
|
= Hiding terms
|
||||||
|
|
||||||
Here's a hidden term: @html[]
|
Here's a hidden term: @html:hide
|
||||||
|
|
||||||
Here's another hidden term: @css[]
|
Here's another hidden term: @css:hidden
|
||||||
|
|
||||||
And here's a shown term: @tps
|
And here's a shown term: @tps
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#import "/lib.typ": *
|
#import "/lib.typ":*
|
||||||
|
|
||||||
#show: init-glossary.with(yaml("glossary.yml"))
|
#show: init-glossary.with(yaml("glossary.yml"))
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
// Our test glossary
|
// Our test glossary
|
||||||
#show: init-glossary.with((
|
#show: init-glossary.with((
|
||||||
Normal: "this is a normal term",
|
Normal: "this is a normal term",
|
||||||
NoRef: "this term is noref'd",
|
NoRef: "this term is noref'd",
|
||||||
NoIndex: "this term is noindex'd",
|
NoIndex: "this term is noindex'd",
|
||||||
NoRefNoIndex: "this term is noref'd and noindex'd",
|
NoRefNoIndex: "this term is noref'd and noindex'd",
|
||||||
))
|
))
|
||||||
|
|
||||||
// Configure styling
|
// Configure styling
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 126 KiB |
@@ -5,20 +5,17 @@
|
|||||||
short: "HTML",
|
short: "HTML",
|
||||||
long: "Hypertext Markup Language",
|
long: "Hypertext Markup Language",
|
||||||
description: "A standard language for creating web pages",
|
description: "A standard language for creating web pages",
|
||||||
group: "Web",
|
group: "Web"),
|
||||||
),
|
|
||||||
css: (
|
css: (
|
||||||
short: "CSS",
|
short: "CSS",
|
||||||
long: "Cascading Style Sheets",
|
long: "Cascading Style Sheets",
|
||||||
description: "A language used for describing the presentation of a document",
|
description: "A language used for describing the presentation of a document",
|
||||||
group: "Web",
|
group: "Web"),
|
||||||
),
|
|
||||||
tps: (
|
tps: (
|
||||||
short: "TPS",
|
short: "TPS",
|
||||||
long: "test procedure specification",
|
long: "test procedure specification",
|
||||||
description: "A document on how to run all the test procedures",
|
description: "A document on how to run all the test procedures"),
|
||||||
),
|
unused: "Unused term, which shouldn't print in the glossary."
|
||||||
unused: "Unused term, which shouldn't print in the glossary.",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
#show: init-glossary.with(myGlossary)
|
#show: init-glossary.with(myGlossary)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
tps: (
|
tps: (
|
||||||
short: "TPS",
|
short: "TPS",
|
||||||
long: "test procedure specification",
|
long: "test procedure specification",
|
||||||
description: "A document on how to run all the test procedures",
|
description: "A document on how to run all the test procedures"
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -294,11 +294,11 @@
|
|||||||
if result != expected {
|
if result != expected {
|
||||||
panic(
|
panic(
|
||||||
"Pluralization failed for: "
|
"Pluralization failed for: "
|
||||||
+ (if singular == none { "none" } else { str(singular) })
|
+ (if singular == none { "none" } else { str(singular) })
|
||||||
+ ". Expected: "
|
+ ". Expected: "
|
||||||
+ (if expected == none { "none" } else { str(expected) })
|
+ (if expected == none { "none" } else { str(expected) })
|
||||||
+ ", got: "
|
+ ", got: "
|
||||||
+ (if result == none { "none" } else { str(result) }),
|
+ (if result == none { "none" } else { str(result) })
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 275 KiB |
|
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 502 KiB |
|
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 534 KiB |
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 376 KiB |
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 407 KiB |
|
After Width: | Height: | Size: 78 KiB |
@@ -37,68 +37,79 @@
|
|||||||
short: "HTML",
|
short: "HTML",
|
||||||
long: "Hypertext Markup Language",
|
long: "Hypertext Markup Language",
|
||||||
description: "A standard language for creating web pages",
|
description: "A standard language for creating web pages",
|
||||||
group: "Web",
|
group: "Web"
|
||||||
),
|
),
|
||||||
|
|
||||||
css: (
|
css: (
|
||||||
short: "CSS",
|
short: "CSS",
|
||||||
long: "Cascading Style Sheets",
|
long: "Cascading Style Sheets",
|
||||||
description: "A language used for describing the presentation of documents",
|
description: "A language used for describing the presentation of documents",
|
||||||
group: "Web",
|
group: "Web"
|
||||||
),
|
),
|
||||||
|
|
||||||
// Term with no description
|
// Term with no description
|
||||||
js: (
|
js: (
|
||||||
short: "JS",
|
short: "JS",
|
||||||
long: "JavaScript",
|
long: "JavaScript",
|
||||||
group: "Web",
|
group: "Web"
|
||||||
),
|
),
|
||||||
|
|
||||||
// Term with only a short field
|
// Term with only a short field
|
||||||
tcp: (
|
tcp: (
|
||||||
short: "TCP",
|
short: "TCP",
|
||||||
group: "Networking",
|
group: "Networking"
|
||||||
),
|
),
|
||||||
|
|
||||||
// Term with only a long field
|
// Term with only a long field
|
||||||
// should panic!
|
// should panic!
|
||||||
//udp: (
|
//udp: (
|
||||||
// long: "User Datagram Protocol",
|
// long: "User Datagram Protocol",
|
||||||
// group: "Networking"
|
// group: "Networking"
|
||||||
//),
|
//),
|
||||||
|
|
||||||
// Term with short and description, but no long
|
// Term with short and description, but no long
|
||||||
ip: (
|
ip: (
|
||||||
short: "IP",
|
short: "IP",
|
||||||
description: "A unique identifier for a host or network interface",
|
description: "A unique identifier for a host or network interface",
|
||||||
group: "Networking",
|
group: "Networking"
|
||||||
),
|
),
|
||||||
|
|
||||||
// Term with custom articles and everything defined
|
// Term with custom articles and everything defined
|
||||||
api: (
|
api: (
|
||||||
short: "API",
|
short: "API",
|
||||||
long: "Application Programming Interface",
|
long: "Application Programming Interface",
|
||||||
description: "A set of protocols and tools for building software",
|
description: "A set of protocols and tools for building software",
|
||||||
article: "an", // custom article for short form
|
article: "an", // custom article for short form
|
||||||
longarticle: "an", // custom article for long form
|
longarticle: "an", // custom article for long form
|
||||||
group: "Software",
|
group: "Software"
|
||||||
),
|
),
|
||||||
|
|
||||||
// Term starting with a vowel, no custom article, to test default a/an logic
|
// Term starting with a vowel, no custom article, to test default a/an logic
|
||||||
xml: (
|
xml: (
|
||||||
short: "XML",
|
short: "XML",
|
||||||
long: "Extensible Markup Language",
|
long: "Extensible Markup Language",
|
||||||
description: "A markup language defining rules for encoding documents",
|
description: "A markup language defining rules for encoding documents",
|
||||||
group: "Data",
|
group: "Data"
|
||||||
),
|
),
|
||||||
|
|
||||||
// Term starting with a consonant, no custom article
|
// Term starting with a consonant, no custom article
|
||||||
cpu: (
|
cpu: (
|
||||||
short: "CPU",
|
short: "CPU",
|
||||||
long: "Central Processing Unit",
|
long: "Central Processing Unit",
|
||||||
description: "The primary component of a computer that performs calculations",
|
description: "The primary component of a computer that performs calculations",
|
||||||
group: "Hardware",
|
group: "Hardware"
|
||||||
),
|
),
|
||||||
|
|
||||||
// Term without any fields (just a string), should be handled gracefully
|
// Term without any fields (just a string), should be handled gracefully
|
||||||
bare: "A bare term with no fields",
|
bare: "A bare term with no fields",
|
||||||
|
|
||||||
// Term with only description
|
// Term with only description
|
||||||
// should panic!
|
// should panic!
|
||||||
//desconly: (
|
//desconly: (
|
||||||
// description: "Just a description, no short or long",
|
// description: "Just a description, no short or long",
|
||||||
// group: "Misc"
|
// group: "Misc"
|
||||||
//),
|
//),
|
||||||
|
|
||||||
// Term with article fields but missing short and long (should test fallback)
|
// Term with article fields but missing short and long (should test fallback)
|
||||||
// should panic!
|
// should panic!
|
||||||
//articonly: (
|
//articonly: (
|
||||||
@@ -107,46 +118,51 @@
|
|||||||
// description: "Has only articles and a description",
|
// description: "Has only articles and a description",
|
||||||
// group: "Misc"
|
// group: "Misc"
|
||||||
//),
|
//),
|
||||||
|
|
||||||
// Term with uppercase key
|
// Term with uppercase key
|
||||||
SSL: (
|
SSL: (
|
||||||
short: "SSL",
|
short: "SSL",
|
||||||
long: "Secure Sockets Layer",
|
long: "Secure Sockets Layer",
|
||||||
description: "A protocol for encrypting information over the internet",
|
description: "A protocol for encrypting information over the internet",
|
||||||
group: "Security",
|
group: "Security"
|
||||||
),
|
),
|
||||||
|
|
||||||
// Term that will not be referenced
|
// Term that will not be referenced
|
||||||
unusedterm: (
|
unusedterm: (
|
||||||
short: "UNUSED",
|
short: "UNUSED",
|
||||||
long: "Unused Term",
|
long: "Unused Term",
|
||||||
description: "Should not appear since it's never referenced",
|
description: "Should not appear since it's never referenced"
|
||||||
),
|
),
|
||||||
|
|
||||||
// Term that tests pluralization with custom fields maybe
|
// Term that tests pluralization with custom fields maybe
|
||||||
doc: (
|
doc: (
|
||||||
short: "doc",
|
short: "doc",
|
||||||
long: "document",
|
long: "document",
|
||||||
description: "A single piece of written matter",
|
description: "A single piece of written matter",
|
||||||
group: "Misc",
|
group: "Misc"
|
||||||
),
|
),
|
||||||
|
|
||||||
// Terms that might require checking conflicting modifiers
|
// Terms that might require checking conflicting modifiers
|
||||||
tps: (
|
tps: (
|
||||||
short: "TPS",
|
short: "TPS",
|
||||||
long: "test procedure specification",
|
long: "test procedure specification",
|
||||||
description: "A document describing test procedures",
|
description: "A document describing test procedures",
|
||||||
group: "Testing",
|
group: "Testing"
|
||||||
),
|
),
|
||||||
|
|
||||||
// Term that might appear multiple times
|
// Term that might appear multiple times
|
||||||
http: (
|
http: (
|
||||||
short: "HTTP",
|
short: "HTTP",
|
||||||
long: "Hypertext Transfer Protocol",
|
long: "Hypertext Transfer Protocol",
|
||||||
description: "A protocol for distributed, collaborative, hypermedia information systems",
|
description: "A protocol for distributed, collaborative, hypermedia information systems",
|
||||||
group: "Web",
|
group: "Web"
|
||||||
),
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
// Initialize the glossary with a custom show-term callback
|
// Initialize the glossary with a custom show-term callback
|
||||||
#show: init-glossary.with(
|
#show: init-glossary.with(
|
||||||
exhaustiveGlossary,
|
exhaustiveGlossary,
|
||||||
show-term: body => [#strong(body)],
|
show-term: (body) => [#strong(body)]
|
||||||
)
|
)
|
||||||
|
|
||||||
#set heading(numbering: "1.1")
|
#set heading(numbering: "1.1")
|
||||||
@@ -277,32 +293,14 @@ This document tries all reference forms and modifiers on a large set of terms.
|
|||||||
|
|
||||||
== Conflicting multiple modifiers combined (short, long, both together)
|
== Conflicting multiple modifiers combined (short, long, both together)
|
||||||
|
|
||||||
Assert that a panic occurs.
|
- @tps:short:long
|
||||||
#import "/src/gloss.typ": __default-format-term, __gls
|
- @tps:short:both
|
||||||
#let manual-gls(key, mods) = __gls(
|
- @tps:long:both
|
||||||
key,
|
- @tps:short:long:both
|
||||||
modes-modifiers: mods,
|
- @html:both:long:short
|
||||||
format-term: __default-format-term,
|
- @doc:long:short
|
||||||
show-term: body => [#strong(body)],
|
- @cpu:both:long:short
|
||||||
term-links: false,
|
- @api:short:long:both
|
||||||
display-text: none,
|
|
||||||
)
|
|
||||||
//- @tps:short:long
|
|
||||||
#assert-panic(manual-gls.with("tps", ("short", "long")))
|
|
||||||
//- @tps:short:both
|
|
||||||
#assert-panic(manual-gls.with("tps", ("short", "both")))
|
|
||||||
//- @tps:long:both
|
|
||||||
#assert-panic(manual-gls.with("tps", ("long", "both")))
|
|
||||||
//- @tps:short:long:both
|
|
||||||
#assert-panic(manual-gls.with("tps", ("short", "long", "both")))
|
|
||||||
//- @html:both:long:short
|
|
||||||
#assert-panic(manual-gls.with("html", ("both", "long", "short")))
|
|
||||||
//- @doc:long:short
|
|
||||||
#assert-panic(manual-gls.with("doc", ("long", "short")))
|
|
||||||
//- @cpu:both:long:short
|
|
||||||
#assert-panic(manual-gls.with("cpu", ("both", "long", "short")))
|
|
||||||
//- @api:short:long:both
|
|
||||||
#assert-panic(manual-gls.with("api", ("short", "long", "both")))
|
|
||||||
|
|
||||||
== Combining capitalization and plural with short/long/both
|
== Combining capitalization and plural with short/long/both
|
||||||
|
|
||||||
@@ -339,19 +337,19 @@ Assert that a panic occurs.
|
|||||||
|
|
||||||
#table(
|
#table(
|
||||||
columns: 3,
|
columns: 3,
|
||||||
table.header([*Input*], [*Output*], [*Comment*]),
|
table.header([*Input*],[*Output*],[*Comment*]),
|
||||||
[`@api` ], [@api], ["default"],
|
[`@api` ], [@api], ["default"],
|
||||||
[`@api:short` ], [@api:short], ["short only"],
|
[`@api:short` ], [@api:short], ["short only"],
|
||||||
[`@api:long` ], [@api:long], ["long only"],
|
[`@api:long` ], [@api:long], ["long only"],
|
||||||
[`@api:both` ], [@api:both], ["both"],
|
[`@api:both` ], [@api:both], ["both"],
|
||||||
[`@api:def` ], [@api:def], ["definition (long)"],
|
[`@api:def` ], [@api:def], ["definition (long)"],
|
||||||
[`@api:desc` ], [@api:desc], ["description"],
|
[`@api:desc` ], [@api:desc], ["description"],
|
||||||
[`@a:api` ], [@a:api], ["article before key"],
|
[`@a:api` ], [@a:api], ["article before key"],
|
||||||
[`@api:a` ], [@api:a], ["article after key"],
|
[`@api:a` ], [@api:a], ["article after key"],
|
||||||
[`@api:cap` ], [@api:cap], ["capitalize"],
|
[`@api:cap` ], [@api:cap], ["capitalize"],
|
||||||
[`@api:pl` ], [@api:pl], ["plural"],
|
[`@api:pl` ], [@api:pl], ["plural"],
|
||||||
[`@api:long:cap`], [@api:long:cap], ["long + cap"],
|
[`@api:long:cap`], [@api:long:cap],["long + cap"],
|
||||||
[`@api:both:pl` ], [@api:both:pl], ["both + pl"],
|
[`@api:both:pl` ], [@api:both:pl], ["both + pl"]
|
||||||
)
|
)
|
||||||
|
|
||||||
== Multiple glossaries with themes and group filtering
|
== Multiple glossaries with themes and group filtering
|
||||||
@@ -368,41 +366,25 @@ Assert that a panic occurs.
|
|||||||
|
|
||||||
== Networking Only
|
== Networking Only
|
||||||
|
|
||||||
#glossary(
|
#glossary(title: "Networking Terms", groups: ("Networking",), theme: theme-basic)
|
||||||
title: "Networking Terms",
|
|
||||||
groups: ("Networking",),
|
|
||||||
theme: theme-basic,
|
|
||||||
)
|
|
||||||
|
|
||||||
== Misc and Data
|
== Misc and Data
|
||||||
|
|
||||||
#glossary(title: "Misc & Data", groups: ("Misc", "Data"), theme: theme-basic)
|
#glossary(title: "Misc & Data", groups: ("Misc","Data"), theme: theme-basic)
|
||||||
|
|
||||||
== Just Testing terms
|
== Just Testing terms
|
||||||
|
|
||||||
#glossary(
|
#glossary(title: "Testing Terms", groups: ("Testing",), theme: theme-chicago-index)
|
||||||
title: "Testing Terms",
|
|
||||||
groups: ("Testing",),
|
|
||||||
theme: theme-chicago-index,
|
|
||||||
)
|
|
||||||
|
|
||||||
== Hardware group
|
== Hardware group
|
||||||
|
|
||||||
#glossary(
|
#glossary(title: "Hardware Terms", groups: ("Hardware",), theme: theme-chicago-index)
|
||||||
title: "Hardware Terms",
|
|
||||||
groups: ("Hardware",),
|
|
||||||
theme: theme-chicago-index,
|
|
||||||
)
|
|
||||||
|
|
||||||
== Unreferenced entries
|
== Unreferenced entries
|
||||||
|
|
||||||
#glossary(
|
#glossary(title: "Unreferenced (Should Contain Unused?)", groups: ("Security",), theme: theme-chicago-index)
|
||||||
title: "Unreferenced (Should Contain Unused?)",
|
|
||||||
groups: ("Security",),
|
|
||||||
theme: theme-chicago-index,
|
|
||||||
)
|
|
||||||
|
|
||||||
== Empty group glossary
|
== Empty group glossary
|
||||||
#glossary(title: "Empty Group Glossary", groups: "", theme: theme-basic)
|
#glossary(title: "Empty Group Glossary", groups: (""), theme: theme-basic)
|
||||||
|
|
||||||
= End of Brutal Test
|
= End of Brutal Test
|
||||||
|
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 652 KiB |
@@ -2,14 +2,14 @@
|
|||||||
|
|
||||||
// Our test glossary
|
// Our test glossary
|
||||||
#show: init-glossary.with((
|
#show: init-glossary.with((
|
||||||
ShortInHeader: "short used in header",
|
ShortInHeader: "short used in header",
|
||||||
ShortInCaption: "short used in caption",
|
ShortInCaption: "short used in caption",
|
||||||
LongInHeader: "long used in header",
|
LongInHeader: "long used in header",
|
||||||
LongInCaption: "long used in caption",
|
LongInCaption: "long used in caption",
|
||||||
BothInHeader: "both used in header",
|
BothInHeader: "both used in header",
|
||||||
BothInCaption: "both used in caption",
|
BothInCaption: "both used in caption",
|
||||||
NormalInHeader: "unmodified use in header",
|
NormalInHeader: "unmodified use in header",
|
||||||
NormalInCaption: "unmodified use in caption",
|
NormalInCaption: "unmodified use in caption",
|
||||||
))
|
))
|
||||||
|
|
||||||
// Configure styling
|
// Configure styling
|
||||||
@@ -21,11 +21,11 @@
|
|||||||
|
|
||||||
// Outlines
|
// Outlines
|
||||||
|
|
||||||
#outline(title: "Table of Contents", indent: auto)
|
#outline(title:"Table of Contents", indent: auto)
|
||||||
#outline(title: "List of Figures", target: figure.where(kind: image))
|
#outline(title: "List of Figures", target: figure.where(kind: image))
|
||||||
#block(
|
#block(
|
||||||
height: 7em,
|
height:7em,
|
||||||
glossary(title: "List of Abbreviations", theme: theme-twocol),
|
glossary(title: "List of Abbreviations", theme: theme-twocol)
|
||||||
)
|
)
|
||||||
|
|
||||||
#line(length: 100%)
|
#line(length: 100%)
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
=== `@ShortInHeader:short` = "@ShortInHeader:short"
|
=== `@ShortInHeader:short` = "@ShortInHeader:short"
|
||||||
=== `@LongInHeader:long` = "@LongInHeader:long"
|
=== `@LongInHeader:long` = "@LongInHeader:long"
|
||||||
=== `@BothInHeader:both:nouse` = "@BothInHeader:both:nouse"
|
=== `@BothInHeader:both` = "@BothInHeader:both"
|
||||||
=== `@NormalInHeader` = "@NormalInHeader"
|
=== `@NormalInHeader` = "@NormalInHeader"
|
||||||
|
|
||||||
#line(length: 100%)
|
#line(length: 100%)
|
||||||
@@ -47,10 +47,7 @@
|
|||||||
|
|
||||||
#figure([], caption: [`@ShortInCaption:short` = "@ShortInCaption:short"])
|
#figure([], caption: [`@ShortInCaption:short` = "@ShortInCaption:short"])
|
||||||
#figure([], caption: [`@LongInCaption:long` = "@LongInCaption:long"])
|
#figure([], caption: [`@LongInCaption:long` = "@LongInCaption:long"])
|
||||||
#figure(
|
#figure([], caption: [`@BothInCaption:both` = "@BothInCaption:both"])
|
||||||
[],
|
|
||||||
caption: [`@BothInCaption:both:nospend` = "@BothInCaption:both:nospend"],
|
|
||||||
)
|
|
||||||
#figure([], caption: [`@NormalInCaption` = "@NormalInCaption"])
|
#figure([], caption: [`@NormalInCaption` = "@NormalInCaption"])
|
||||||
|
|
||||||
#line(length: 100%)
|
#line(length: 100%)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#show: init-glossary.with((
|
#show: init-glossary.with((
|
||||||
one: "this is term one",
|
one: "this is term one",
|
||||||
two: "term two also",
|
two: "term two also"
|
||||||
))
|
))
|
||||||
|
|
||||||
#set page(
|
#set page(
|
||||||
@@ -19,15 +19,15 @@ shown anyway.
|
|||||||
|
|
||||||
#glossary(
|
#glossary(
|
||||||
theme: theme-chicago-index,
|
theme: theme-chicago-index,
|
||||||
show-all: true,
|
show-all: true
|
||||||
)
|
)
|
||||||
|
|
||||||
#glossary(
|
#glossary(
|
||||||
theme: theme-compact,
|
theme: theme-compact,
|
||||||
show-all: true,
|
show-all: true
|
||||||
)
|
)
|
||||||
|
|
||||||
#glossary(
|
#glossary(
|
||||||
theme: theme-table,
|
theme: theme-table,
|
||||||
show-all: true,
|
show-all: true
|
||||||
)
|
)
|
||||||
@@ -22,11 +22,11 @@
|
|||||||
tps: (
|
tps: (
|
||||||
short: "TPS",
|
short: "TPS",
|
||||||
long: "test procedure specification",
|
long: "test procedure specification",
|
||||||
description: "A document on how to run all the test procedures",
|
description: "A document on how to run all the test procedures"
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
#show: init-glossary.with(myGlossary, show-term: body => [#emph(body)])
|
#show: init-glossary.with(myGlossary, show-term: (body) => [#emph(body)])
|
||||||
|
|
||||||
#set page(numbering: "1")
|
#set page(numbering: "1")
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
),
|
),
|
||||||
iphone: (
|
iphone: (
|
||||||
short: "iPhone",
|
short: "iPhone",
|
||||||
description: "Revolutionized phones.",
|
description: "Revolutionized phones."
|
||||||
),
|
),
|
||||||
css: (
|
css: (
|
||||||
short: "CSS",
|
short: "CSS",
|
||||||
@@ -21,11 +21,11 @@
|
|||||||
tps: (
|
tps: (
|
||||||
short: "TPS",
|
short: "TPS",
|
||||||
long: "test procedure specification",
|
long: "test procedure specification",
|
||||||
description: "A document on how to run all the test procedures",
|
description: "A document on how to run all the test procedures"
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
#show: init-glossary.with(myGlossary, show-term: body => [#emph(body)])
|
#show: init-glossary.with(myGlossary, show-term: (body) => [#emph(body)])
|
||||||
|
|
||||||
#set page(
|
#set page(
|
||||||
margin: 1cm,
|
margin: 1cm,
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
#text(size: 24pt, weight: "bold")[`glossy`: theme gallery]
|
#text(size: 24pt, weight: "bold")[`glossy`: theme gallery]
|
||||||
|
|
||||||
#text(size: 1pt, fill: rgb(0, 0, 0, 0))[
|
#text(size: 1pt, fill: rgb(0,0,0,0))[
|
||||||
First, we refer to each term at least once so they'll actually show up in the
|
First, we refer to each term at least once so they'll actually show up in the
|
||||||
glossaries. Our terms include: @atom, @iphone, @html:cap, @css, and @tps.
|
glossaries. Our terms include: @atom, @iphone, @html:cap, @css, and @tps.
|
||||||
]
|
]
|
||||||
@@ -48,8 +48,8 @@
|
|||||||
width: 100%,
|
width: 100%,
|
||||||
spacing: 2em,
|
spacing: 2em,
|
||||||
inset: 1em,
|
inset: 1em,
|
||||||
stroke: 1pt + gray,
|
stroke: 1pt+gray,
|
||||||
height: if theme.first() == "theme-twocol" { 1.5in } else { auto },
|
height: if theme.first() == "theme-twocol" { 1.5in } else { auto },
|
||||||
glossary(title: raw(theme.first()), theme: theme.last(), ignore-case: true),
|
glossary(title: raw(theme.first()), theme: theme.last(), ignore-case: true)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#import "/lib.typ": *
|
#import "/lib.typ":*
|
||||||
|
|
||||||
#set text(lang: "cs", region: "CZ")
|
#set text(lang: "cs", region: "CZ")
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 650 KiB After Width: | Height: | Size: 140 KiB |
|
Before Width: | Height: | Size: 906 KiB After Width: | Height: | Size: 117 KiB |
@@ -1,12 +1,12 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "glossy"
|
name = "glossy"
|
||||||
version = "0.9.0"
|
version = "0.8.0"
|
||||||
compiler = "0.14.0"
|
compiler = "0.13.0"
|
||||||
entrypoint = "lib.typ"
|
entrypoint = "lib.typ"
|
||||||
authors = ["Stephen Waits <steve@waits.net>"]
|
authors = ["Stephen Waits <steve@waits.net>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
description = "A very simple glossary system with easily customizable output."
|
description = "A very simple glossary system with easily customizable output."
|
||||||
categories = ["model"]
|
categories = ["model"]
|
||||||
keywords = ["glossary", "index", "dictionary", "gloss"]
|
keywords = ["glossary", "index", "dictionary", "gloss"]
|
||||||
repository = "https://git.swaits.com/swaits/typst-collection"
|
repository = "https://github.com/swaits/typst-collection"
|
||||||
exclude = ["justfile", "thumbnail.png", "themeshots.png", "tests", "bin"]
|
exclude = ["thumbnail.png", "themeshots.png", "tests", "bin"]
|
||||||
@@ -8,7 +8,7 @@ description = "A formal business letter template."
|
|||||||
categories = ["office"]
|
categories = ["office"]
|
||||||
disciplines = ["business", "communication"]
|
disciplines = ["business", "communication"]
|
||||||
keywords = ["professional", "business", "letter", "correspondence"]
|
keywords = ["professional", "business", "letter", "correspondence"]
|
||||||
repository = "https://git.swaits.com/swaits/typst-collection"
|
repository = "https://github.com/swaits/typst-collection"
|
||||||
|
|
||||||
[template]
|
[template]
|
||||||
path = "template"
|
path = "template"
|
||||||
|
|||||||
@@ -7,5 +7,5 @@ license = "MIT"
|
|||||||
description = "Bring RFC language into everyday docs"
|
description = "Bring RFC language into everyday docs"
|
||||||
categories = ["utility"]
|
categories = ["utility"]
|
||||||
keywords = ["rfc", "keywords", "rfc2119", "rfc8174", "bcp14"]
|
keywords = ["rfc", "keywords", "rfc2119", "rfc8174", "bcp14"]
|
||||||
repository = "https://git.swaits.com/swaits/typst-collection"
|
repository = "https://github.com/swaits/typst-collection"
|
||||||
exclude = ["thumbnail.png", "tests"]
|
exclude = ["thumbnail.png", "tests"]
|
||||||
@@ -7,5 +7,5 @@ license = "MIT"
|
|||||||
description = "Functions to create various run-in lists."
|
description = "Functions to create various run-in lists."
|
||||||
categories = ["model"]
|
categories = ["model"]
|
||||||
keywords = ["run-in", "enum", "list", "terms"]
|
keywords = ["run-in", "enum", "list", "terms"]
|
||||||
repository = "https://git.swaits.com/swaits/typst-collection"
|
repository = "https://github.com/swaits/typst-collection"
|
||||||
exclude = ["thumbnail.png", "tests", "bin", "docs/manual.pdf"]
|
exclude = ["thumbnail.png", "tests", "bin", "docs/manual.pdf"]
|
||||||
@@ -7,5 +7,5 @@ license = "MIT"
|
|||||||
description = "Render those funky logos for TeX, LaTeX, and friends."
|
description = "Render those funky logos for TeX, LaTeX, and friends."
|
||||||
categories = ["utility"]
|
categories = ["utility"]
|
||||||
keywords = ["tex", "latex", "luatex", "xetex", "lualatex", "xelatex", "logo"]
|
keywords = ["tex", "latex", "luatex", "xetex", "lualatex", "xelatex", "logo"]
|
||||||
repository = "https://git.swaits.com/swaits/typst-collection"
|
repository = "https://github.com/swaits/typst-collection"
|
||||||
exclude = ["thumbnail.png", "tests"]
|
exclude = ["thumbnail.png", "tests"]
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
RSYNC_OPTS="--archive --delete --itemize-changes --human-readable"
|
RSYNC_OPTS="--archive --delete --itemize-changes --human-readable"
|
||||||
|
|
||||||
# Set the destination base directory
|
# Set the destination base directory
|
||||||
DEST_DIR="$HOME/Code/typst-packages-fork/packages/preview"
|
DEST_DIR="$HOME/Code/forks/typst-packages-fork/packages/preview"
|
||||||
|
|
||||||
# Ensure the destination base directory exists
|
# Ensure the destination base directory exists
|
||||||
mkdir -p "$DEST_DIR"
|
mkdir -p "$DEST_DIR"
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ authors = ["Stephen Waits <steve@waits.net>"]
|
|||||||
license = "MIT"
|
license = "MIT"
|
||||||
description = "A carefully curated collection of font pairings."
|
description = "A carefully curated collection of font pairings."
|
||||||
keywords = ["font", "pairing", "typography"]
|
keywords = ["font", "pairing", "typography"]
|
||||||
repository = "https://git.swaits.com/swaits/typst-collection"
|
repository = "https://github.com/swaits/typst-collection"
|
||||||
exclude = ["thumbnail.png", "tests"]
|
exclude = ["thumbnail.png", "tests"]
|
||||||