docify
docify copied to clipboard
`docify::embed_diff`
#![doc = docify::embed_diff("file_path.rs", item_1, item_2)]
There must be good diff
libs for rust, and the rest is more or less simple, I presume. We read the two excerpts, pass them to the fn diff(a, b)
, which I presume would return some sort of diff-style string, and use that.
How crazy is this?
cc @shawntabrizi
This would be cool, and yes there should be good crates for this, and as long as we use diff
on the code blocks, it should syntax highlight I think
For context, when writing tutorials, it is common to have before and after steps (both of which compile), and want to present a diff from the two.
At least that is the clear use case for me.