Crates.io | htmldiff |
lib.rs | htmldiff |
version | 0.1.0 |
source | src |
created_at | 2018-10-08 12:51:49.849355 |
updated_at | 2018-10-08 12:51:49.849355 |
description | htmldiff is a Rust port of https://github.com/myobie/htmldiff |
homepage | https://github.com/seikichi/htmldiff |
repository | https://github.com/seikichi/htmldiff |
max_upload_size | |
id | 88690 |
size | 19,436 |
Rust port of myobie/htmldiff.
$ cargo install htmldiff
You can download prebuilt binaries in the releases section, or create from source.
$ git clone https://github.com/seikichi/htmldiff.git
$ cd htmldiff
$ cargo build --release
$ cat old.html
<p>Hello, world!</p>
$ cat new.html
<p>Hello, seikichi!</p>
$ htmldiff old.html new.html
<p>Hello, <del>world!</del><ins>seikichi!</ins></p>
Add the following to your Cargo.toml file:
[dependencies]
htmldiff = "0.1"
Next, call htmldiff::htmldiff
function in your code:
extern crate htmldiff;
fn main() {
let old = "<p>Hello, world!</p>";
let new = "<p>Hello, seikichi!</p>";
println!("{}", htmldiff::htmldiff(old, new));
}
MIT