make abbreviations clickable

This commit is contained in:
2025-10-10 20:17:55 +02:00
parent 0ae7db2cd3
commit c63864159a
2 changed files with 9 additions and 3 deletions

View File

@@ -18,10 +18,11 @@
} }
"(" + abbrs.pairs().map((v) => { v.at(0) + ":\"" + v.at(1) + "\"" }).join(",") + ")" "(" + abbrs.pairs().map((v) => { v.at(0) + ":\"" + v.at(1) + "\"" }).join(",") + ")"
}); });
let target_label = label("abbr_" + abbreviation);
if type(text) != type(none) { if type(text) != type(none) {
text + " (" + abbreviation + ")"; link(target_label, text + " (" + abbreviation + ")");
} else { } else {
abbreviation; link(target_label, abbreviation)
} }
} }

View File

@@ -400,7 +400,12 @@
gutter: 1em, gutter: 1em,
..abbrs.pairs().map((a) => { ..abbrs.pairs().map((a) => {
( (
align(left, block(text(a.at(0), weight: "bold"), width: max_abbr_width + 1em)), align(left, {
[
#block(text(a.at(0), weight: "bold"), width: max_abbr_width + 1em)
#label("abbr_" + a.at(0))
]
}),
text(a.at(1)) text(a.at(1))
) )
}).flatten() }).flatten()