Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docify::embed_diff #20

Open
kianenigma opened this issue Oct 30, 2023 · 2 comments
Open

docify::embed_diff #20

kianenigma opened this issue Oct 30, 2023 · 2 comments

Comments

@kianenigma
Copy link

#![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

@sam0x17
Copy link
Owner

sam0x17 commented Oct 30, 2023

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

@shawntabrizi
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants