Add show-all flag to glossary() and test-case

This commit is contained in:
Niam Patel authored and Stephen Waits committed 2025-04-03 08:46:11 -07:00
1 parent 3264971bfe
commit b899c875c9
2 files changed
+39 -1

No files matched your search

+6 -1
View File
@@ -603,6 +603,7 @@
sort: true,
ignore-case: false,
groups: (),
show-all: false,
) = context {
// Type checking
let checked-title = z.parse(title, z.content(), scope: ("title",))
@@ -613,7 +614,11 @@
// Collect and organize entries by group
let output = (:)
let all_entries = __gloss_entries.final()
let all_used = all_entries.keys().filter(key => __is_term_ever_used(key))
let all_used = if not show-all {
all_entries.keys().filter(key => __is_term_ever_used(key))
} else {
all_entries.keys()
}
// Determine which groups to process
let all_groups = all_entries
+33
View File
@@ -0,0 +1,33 @@
#import "/lib.typ": *
#show: init-glossary.with((
one: "this is term one",
two: "term two also"
))
#set page(
margin: 1em,
width: 3.5in,
height: auto,
)
#set text(size: 10pt)
In this document we don't reference our glossary items but expect them to be
shown anyway.
#glossary(show-all: true)
#glossary(
theme: theme-chicago-index,
show-all: true
)
#glossary(
theme: theme-compact,
show-all: true
)
#glossary(
theme: theme-table,
show-all: true
)