add: figure plugin

This commit is contained in:
agryphus 2026-04-27 13:46:43 -04:00
parent 68ed807e95
commit 4b2918853b
3 changed files with 18 additions and 1 deletions

15
prepends/figure.typ Normal file
View file

@ -0,0 +1,15 @@
#show figure: it => {
if it.body.func() == image {
let src = it.body.source
let dot-pos = src.rev().position(".")
let full-src = if dot-pos != none {
src.slice(0, src.len() - dot-pos - 1) + "_full" + src.slice(src.len() - dot-pos - 1)
} else {
src + "_full"
}
show image: img => link(full-src, img)
it
} else {
it
}
}