feat(glossy): add type-checking

- adds type-checking via the valkyrie package
- fixes handling of groups parameter on #glossary()
- new test for relevant changes
This commit is contained in:
swaits committed 2024-12-16 18:30:09 -07:00
1 parent d2e44f4131
commit 0a87404a18
9 files changed
+112 -10

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
// TODO: change to @preview when online
#import "@preview/valkyrie:0.2.1" as z
#let dict-schema = z.either(
z.string(),
z.dictionary(
(
short: z.content(), // this is the only required field
plural: z.content(optional: true),
long: z.content(optional: true),
longplural: z.content(optional: true),
description: z.content(optional: true),
group: z.content(optional: true),
)
)
)
#let theme-schema = z.dictionary(
(
section: z.function(),
group: z.function(),
entry: z.function(),
)
)
#let groups-list-schema = z.array(pre-transform: z.coerce.array)