Compare commits
2
Commits
glossy-0.4.0
...
issue-18
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
138566c506
|
||
|
|
fd4b7ceed6
|
No files matched your search
+1
-1
@@ -41,7 +41,7 @@ different goals:
|
|||||||
### Import the package
|
### Import the package
|
||||||
|
|
||||||
```typst
|
```typst
|
||||||
#import "@preview/glossy:0.4.0": *
|
#import "@preview/glossy:0.4.1": *
|
||||||
```
|
```
|
||||||
|
|
||||||
### Defining Glossary Terms
|
### Defining Glossary Terms
|
||||||
|
|||||||
@@ -569,7 +569,7 @@
|
|||||||
// 1. create array of tuples with (lower [if ignore-case], entry)
|
// 1. create array of tuples with (lower [if ignore-case], entry)
|
||||||
.map(e => { if ignore-case { (lower(e.short), e) } else { (e.short, e) } })
|
.map(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(key: t => t.first())
|
.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
|
||||||
.map(t => t.last())
|
.map(t => t.last())
|
||||||
|
|
||||||
|
|||||||
@@ -203,7 +203,7 @@
|
|||||||
|
|
||||||
if is_acronym {
|
if is_acronym {
|
||||||
// Use acronym rules
|
// Use acronym rules
|
||||||
let first_char = upper_word.slice(0,1)
|
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 {
|
||||||
@@ -211,7 +211,7 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Non-acronym rules
|
// Non-acronym rules
|
||||||
let first_char = lower_word.slice(0,1)
|
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 = (
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
cab:
|
||||||
|
short: "cab"
|
||||||
|
long: "taxi cab"
|
||||||
|
|
||||||
|
coo:
|
||||||
|
short: "COO"
|
||||||
|
long: "Chief Operations Officer"
|
||||||
|
|
||||||
|
cuckoo:
|
||||||
|
short: "cuckoo"
|
||||||
|
long: "really crazy"
|
||||||
|
|
||||||
|
delta:
|
||||||
|
short: "delta"
|
||||||
|
long: "difference between two values"
|
||||||
|
|
||||||
|
dal:
|
||||||
|
short: "DAL"
|
||||||
|
long: "Delta Airlines"
|
||||||
|
|
||||||
|
čr:
|
||||||
|
short: "ČR"
|
||||||
|
long: "Česká Republika"
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 133 KiB |
@@ -0,0 +1,20 @@
|
|||||||
|
#import "/lib.typ":*
|
||||||
|
|
||||||
|
#set text(lang: "cs", region: "CZ")
|
||||||
|
|
||||||
|
#show: init-glossary.with(yaml("glossary.yml"))
|
||||||
|
#glossary(ignore-case: true)
|
||||||
|
|
||||||
|
#line(length: 20em)
|
||||||
|
|
||||||
|
@čr
|
||||||
|
|
||||||
|
@cab
|
||||||
|
|
||||||
|
@coo
|
||||||
|
|
||||||
|
@cuckoo
|
||||||
|
|
||||||
|
@delta
|
||||||
|
|
||||||
|
@dal
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "glossy"
|
name = "glossy"
|
||||||
version = "0.4.0"
|
version = "0.4.1"
|
||||||
entrypoint = "lib.typ"
|
entrypoint = "lib.typ"
|
||||||
authors = ["Stephen Waits <steve@waits.net>"]
|
authors = ["Stephen Waits <steve@waits.net>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
Reference in new issue
Block a user