diff --git a/examples/groups/groups.typ b/examples/groups/groups.typ index 4c11d94..1fcd1fb 100644 --- a/examples/groups/groups.typ +++ b/examples/groups/groups.typ @@ -30,7 +30,7 @@ long: "Default2", description: lorem(25), group: "", // Please note that an empty group has the same effect as no group - ), + ), ) #register-glossary(entry-list) @@ -52,3 +52,68 @@ Reference to @bor entry-list, show-all: true, ) + += Glossary with custom group heading level + +#let entry-list-2 = ( + ( + key: "A", + short: "A", + group: "Group A", + ), + ( + key: "B", + short: "B", + group: "Group B", + ), +) +#register-glossary(entry-list-2) + +Reference to @A +Reference to @B + +#print-glossary( + entry-list-2, + show-all: true, + group-heading-level: 3, +) + += Glossary with custom group display + +#let entry-list-3 = ( + ( + key: "C", + short: "C", + group: "Group C", + ), + ( + key: "D", + short: "D", + group: "Group D", + ), + ( + key: "E", + short: "E", + ), +) +#register-glossary(entry-list-3) + +// Reference to @C // Error: Reference to @C not found +// Reference to @D // Error: Reference to @D not found +Reference to @E (no group) + +== Show default group + +#print-glossary( + entry-list-3, + groups: ("",), + show-all: true, +) + +== Show Group C and Group D + +#print-glossary( + entry-list-3, + groups: ("Group C", "Group D"), + show-all: true, +) \ No newline at end of file diff --git a/tests/debug/debug.typ b/tests/debug/debug.typ index 5d02c67..d69c256 100644 --- a/tests/debug/debug.typ +++ b/tests/debug/debug.typ @@ -216,6 +216,28 @@ Force long when empty defaults to plural: #glspl("potato A", long: true) #gls-group("potato D") +== #count-refs + +#context count-refs((key: "potato D")) + +== #count-all-refs + +All refs: #context count-all-refs() + +Only list 4: #context count-all-refs(entry-list: entry-list-4) + +== #there-are-refs + +true: #context there-are-refs() + +false: #context there-are-refs(groups: (" ",)) + +#context if there-are-refs(entry-list: ((key: "potato A"),)) [ + There are refs to potato A in the document. +] else [ + There are no refs to potato A in the document. +] + == test `__attribute_is_empty` error // #gls-long("potato A")