Add show-all flag to glossary() and test-case
This commit is contained in:
1 parent
3264971bfe
commit
b899c875c9
2 files changed
+39
-1
No files matched your search
@@ -603,6 +603,7 @@
|
|||||||
sort: true,
|
sort: true,
|
||||||
ignore-case: false,
|
ignore-case: false,
|
||||||
groups: (),
|
groups: (),
|
||||||
|
show-all: false,
|
||||||
) = context {
|
) = context {
|
||||||
// Type checking
|
// Type checking
|
||||||
let checked-title = z.parse(title, z.content(), scope: ("title",))
|
let checked-title = z.parse(title, z.content(), scope: ("title",))
|
||||||
@@ -613,7 +614,11 @@
|
|||||||
// Collect and organize entries by group
|
// Collect and organize entries by group
|
||||||
let output = (:)
|
let output = (:)
|
||||||
let all_entries = __gloss_entries.final()
|
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
|
// Determine which groups to process
|
||||||
let all_groups = all_entries
|
let all_groups = all_entries
|
||||||
|
|||||||
@@ -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
|
||||||
|
)
|
||||||
Reference in new issue
Block a user