aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-24 21:39:09 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-24 21:39:09 +0100
commit112b7019ebca79bcc9690fc054df7fd3c64d347c (patch)
tree548e87ee9e1f033271e25457cedc9c14caf5e0b9
parent9d67e02e6c384ff4c4d35efc442d558b023058c3 (diff)
add more configuration option validation
-rw-r--r--lib.typ17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib.typ b/lib.typ
index 8c18b25..3828b3e 100644
--- a/lib.typ
+++ b/lib.typ
@@ -18,6 +18,17 @@
#let metalogo(..opts) = context{
config.update(c => {
for (key, value) in opts.named() {
+ assert(
+ c.at(key, default: none) != none,
+ message: "metalogo: Unknown option \"" + key + "\""
+ )
+ let expected_type = type(c.at(key))
+ let actual_type = type(value)
+ assert(
+ expected_type == actual_type,
+ message: "metalogo: Option \"" + key + "\" has type `" +
+ str(expected_type) + "` but was assigned a `" + str(actual_type) + "`"
+ )
c.insert(key, value)
}
return c
@@ -75,9 +86,11 @@
#let LuaTeX = box[Lua#TeX]
#let LaTeXe = context[#box[#{
+ let cfg = config.get()
+
LaTeX
- // TODO: both of these are separate components in LaTeX's metalogo
+ h(cfg.kern-x2)
[2]
- sym.epsilon
+ [$attach(, b: #sym.epsilon)$]
}]]