From 62920284168f279fd2fecdab474fdb66c31e2ee1 Mon Sep 17 00:00:00 2001 From: vky Date: Sun, 16 Aug 2026 14:38:06 +0200 Subject: [PATCH] changed formatter --- chapters/introduction/presentation.typ | 2 +- setup/glossary.typ | 128 ++++++++++++------------- 2 files changed, 65 insertions(+), 65 deletions(-) diff --git a/chapters/introduction/presentation.typ b/chapters/introduction/presentation.typ index 7fcfc63..b25606c 100644 --- a/chapters/introduction/presentation.typ +++ b/chapters/introduction/presentation.typ @@ -1,4 +1,4 @@ -#import "../../setup/setup.typ": nogls, gls, ravhelp +#import "../../setup/setup.typ": gls, nogls, ravhelp = Introduction diff --git a/setup/glossary.typ b/setup/glossary.typ index 3218152..c7c68cd 100644 --- a/setup/glossary.typ +++ b/setup/glossary.typ @@ -1,82 +1,82 @@ // Safe but unneeded for now #let eval-typst(value) = { - // eval(value) - eval( - value, - scope: ( - box: box, - image: image, - text: text, - sym: sym, - ), - ) + // eval(value) + eval( + value, + scope: ( + box: box, + image: image, + text: text, + sym: sym, + ), + ) } #let read-glossary-entries(file) = { - yaml(file).map(entry => { - let result = (:) + yaml(file).map(entry => { + let result = (:) - for (key, value) in entry { - result.insert( - key, - if type(value) == dictionary and value.at("typst", default: none) != none { - eval-typst(value.typst) - } else if key == "short" { - if value == none { - none - } else if type(value) == str { - eval(value, mode: "markup") - } - } else if key == "long" { - value - } - else if key == "description" { - if value == none { - none - } else if type(value) == str { - eval(value, mode: "markup") - } else { - value - } - } else { - value - }, - ) - } + for (key, value) in entry { + result.insert( + key, + if type(value) == dictionary + and value.at("typst", default: none) != none { + eval-typst(value.typst) + } else if key == "short" { + if value == none { + none + } else if type(value) == str { + eval(value, mode: "markup") + } + } else if key == "long" { + value + } else if key == "description" { + if value == none { + none + } else if type(value) == str { + eval(value, mode: "markup") + } else { + value + } + } else { + value + }, + ) + } - result - }) + result + }) } #let read-glossary(files) = { - let entries = () + let entries = () - if type(files) != array { - files = (files,) - } + if type(files) != array { + files = (files,) + } - for file in files { - let new = read-glossary-entries(file) + for file in files { + let new = read-glossary-entries(file) - for entry in new { - let duplicate = entries.find(e => e.key == entry.key) + 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 - + "`", - ) - } - } + if duplicate != none { + panic( + "Found duplicate key `" + + entry.key + + "` in files `" + + file + + "` and `" + + duplicate.file + + "`", + ) + } + } - entries += new - } + entries += new + } - entries + entries } #let glossary = read-glossary("../data/src/glossary.yml")