diff --git a/chapters/introduction/presentation.typ b/chapters/introduction/presentation.typ index 82f2e0f..d95cf21 100644 --- a/chapters/introduction/presentation.typ +++ b/chapters/introduction/presentation.typ @@ -1,6 +1,5 @@ #import "../../setup/setup.typ": gls, nogls, ravhelp - = Introduction @fk_draan:short. diff --git a/setup/glossary.typ b/setup/glossary.typ index 15fe455..13dd5e2 100644 --- a/setup/glossary.typ +++ b/setup/glossary.typ @@ -17,6 +17,7 @@ yaml(file).map(entry => { let result = (:) + // ----- Convert each YAML field to its Typst representation ----- for (key, value) in entry { result.insert( key, @@ -45,6 +46,14 @@ ) } + // ----- Fill in missing optional fields ----- + if "short" not in result { + result.insert("short", none) + } + if "sort" not in result { + result.insert("sort", result.long) + } + result }) } @@ -53,6 +62,7 @@ #let read-glossary(files) = { let entries = () + // ----- Normalize a single file into an array ----- if type(files) != array { files = (files,) } @@ -60,18 +70,13 @@ for file in files { let new = read-glossary-entries(file) + // ----- Reject duplicate glossary keys ----- for entry in new { let duplicate = entries.find(e => e.key == entry.key) if duplicate != none { panic( - "Found duplicate key `" - + entry.key - + "` in files `" - + file - + "` and `" - + duplicate.file - + "`", + "Found duplicate key `" + entry.key + "` in files `" + file + "`", ) } }