Thank you for this tool!
I played around with it a bit, and to my surprise, it seems that it's currently not possible to diff the content yielded by custom functions.
I am using typdiff version 0.1.1, installed via cargo install --locked typdiff.
Consider the following 3 files:
config.typ:
#let my-stack(one, two, three) = stack(
dir: ttb,
spacing: 1em,
one,
two,
three,
)
old.typ:
#import "config.typ": *
#my-stack("a", "b", "c")
new.typ:
#import "config.typ": *
#my-stack("a", "b", "d")
Then, typdiff yields:
$ typdiff old.typ new.typ
#let diff-added(body) = {
set text(fill: rgb("#0000ff"))
underline(body)
}
#let diff-deleted(body) = {
set text(fill: rgb("#cc0000"))
strike(body)
}
#import "config.typ": *
// #my-stack("a", "b", "c")
#my-stack("a", "b", "d")
But I would expect this instead:
#let diff-added(body) = {
set text(fill: rgb("#0000ff"))
underline(body)
}
#let diff-deleted(body) = {
set text(fill: rgb("#cc0000"))
strike(body)
}
#import "config.typ": *
#my-stack("a", "b", {diff-deleted("c"); diff-added("d")})
The latter highlights the difference in the arguments passed to my-stack(), while the former does not.
Is this a feature you plan to support? How hard would it be to implement?
Thank you for this tool!
I played around with it a bit, and to my surprise, it seems that it's currently not possible to diff the content yielded by custom functions.
I am using
typdiffversion 0.1.1, installed viacargo install --locked typdiff.Consider the following 3 files:
config.typ:
old.typ:
new.typ:
Then,
typdiffyields:But I would expect this instead:
The latter highlights the difference in the arguments passed to
my-stack(), while the former does not.Is this a feature you plan to support? How hard would it be to implement?