Skip to content

Commit

Permalink
Fix plural of string type acronyms to guess plural as per other defin…
Browse files Browse the repository at this point in the history
…ition types. Close #14
  • Loading branch information
grizzly committed Jan 13, 2025
1 parent 601fba5 commit 02753c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/preview/acrostiche/dev/acrostiche.typ
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

// The Definition is a string============
if type(defs) == str{ // If user defined only one version and forgot the trailing comma the type is string
if plural{panic("You requested the plural version of the acronym but it seems like you only provided the singular version in #init-acronyms(dict)")}
if plural{defs+"s"}
else{defs} // All is good, we return the definition found as the singular version
}

Expand Down
5 changes: 5 additions & 0 deletions packages/preview/acrostiche/dev/test.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#import "@preview/acrostiche:0.0.0": *

#init-acronyms((
"STA": "String Type Acronym",
"PFT": ("Package For Typst","Packages For Typst"),
"AJT": ("Amicale des Joyeux Typistes"),
"ada": (short:[#text(fill:aqua)[ADA]], short-pl:"ADAs", long:"Advanced Definition Acronym", long-pl:"Advanced Definitions Acronyms"),
Expand Down Expand Up @@ -32,6 +33,10 @@ Full definition of #acrf("PFT") and full plural definition of #acrfpl("PFT").
First use of #acr("AJT") and second use of #acr("AJT").\
#ref("First use of Amicale des Joyeux Typistes (AJT) and second use of AJT.")

== Plural with string only definition
First use of #acrpl("STA") and second use of #acrpl("STA").\
#ref("First use of String Type Acronyms (STAs) and second use of STAs.")

== Acronym with Advanced Definitions

First use of #acr("ada") and second use of #acr("ada").\
Expand Down

0 comments on commit 02753c1

Please sign in to comment.