From e008aa16f413e4c8c41b02706c7ca409c89ba5bc Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Wed, 4 Oct 2023 01:48:11 -0700 Subject: [PATCH] Clean up abbreviations --- abbreviations-used-example.typ | 4 ++-- abbreviations.typ | 13 +------------ justfile | 2 +- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/abbreviations-used-example.typ b/abbreviations-used-example.typ index e4f80f1..370b04d 100644 --- a/abbreviations-used-example.typ +++ b/abbreviations-used-example.typ @@ -1,4 +1,4 @@ -#import "linguistic-abbreviations.typ": * +#import "abbreviations.typ": * #let custom-abbreviations = ( "FMNT": "Present/Future stem formant", @@ -7,7 +7,7 @@ #let fmnt = emit-abbreviation("FMNT") // 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 => { for t in t.children [ diff --git a/abbreviations.typ b/abbreviations.typ index 8f53abb..c99c3cd 100644 --- a/abbreviations.typ +++ b/abbreviations.typ @@ -93,22 +93,11 @@ // Accepts a callback that accepts the state of the `used-abbreviations` // 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 => { 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) - }) - } #let render-abbreviation(symbol) = smallcaps(lower(symbol)) diff --git a/justfile b/justfile index f7d5ae0..3a13e4a 100644 --- a/justfile +++ b/justfile @@ -6,6 +6,6 @@ default: build-doc: typst compile documentation.typ - +# Build the abbbreviations-used example build-abbreviations-example: typst compile abbreviations-used-example.typ