add: figure plugin
This commit is contained in:
parent
68ed807e95
commit
4b2918853b
3 changed files with 18 additions and 1 deletions
3
build.rs
Normal file
3
build.rs
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
fn main() {
|
||||||
|
println!("cargo:rerun-if-changed=prepends/");
|
||||||
|
}
|
||||||
15
prepends/figure.typ
Normal file
15
prepends/figure.typ
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
#let image = (..) => [IMAGE]
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue