Clean up abbreviations

This commit is contained in:
Greg Shuflin 2023-10-04 01:48:11 -07:00
parent 55545eeccc
commit e008aa16f4
3 changed files with 4 additions and 15 deletions

View File

@ -1,4 +1,4 @@
#import "linguistic-abbreviations.typ": * #import "abbreviations.typ": *
#let custom-abbreviations = ( #let custom-abbreviations = (
"FMNT": "Present/Future stem formant", "FMNT": "Present/Future stem formant",
@ -7,7 +7,7 @@
#let fmnt = emit-abbreviation("FMNT") #let fmnt = emit-abbreviation("FMNT")
// An example function that uses `with-used-abbreviations` // An example function that uses `with-used-abbreviations`
#let print_usage_chart = with-used-abbreviations.with(debug: false)(final-used-abbreviations => { #let print_usage_chart = with-used-abbreviations(final-used-abbreviations => {
show terms: t => { show terms: t => {
for t in t.children [ for t in t.children [

View File

@ -93,22 +93,11 @@
// Accepts a callback that accepts the state of the `used-abbreviations` // Accepts a callback that accepts the state of the `used-abbreviations`
// dictionary at the end of the document. Also an additional debug parameter // dictionary at the end of the document. Also an additional debug parameter
#let with-used-abbreviations(callback, debug: false) = { #let with-used-abbreviations(callback) = {
locate(loc => { locate(loc => {
let final_used-abbreviations = used-abbreviations.final(loc) let final_used-abbreviations = used-abbreviations.final(loc)
if debug {
for (key, value) in final_used-abbreviations {
[#key was used: #value]
linebreak()
}
linebreak()
}
callback(final_used-abbreviations) callback(final_used-abbreviations)
}) })
} }
#let render-abbreviation(symbol) = smallcaps(lower(symbol)) #let render-abbreviation(symbol) = smallcaps(lower(symbol))

View File

@ -6,6 +6,6 @@ default:
build-doc: build-doc:
typst compile documentation.typ typst compile documentation.typ
# Build the abbbreviations-used example
build-abbreviations-example: build-abbreviations-example:
typst compile abbreviations-used-example.typ typst compile abbreviations-used-example.typ