htmldiff
This tool compares old and new versions of html and generates color-coded html in a diff format.
Install
Homebrew
brew install kemokemo/tap/htmldiff
Scoop
First, add my scoop-bucket.
scoop bucket add kemokemo-bucket https://github.com/kemokemo/scoop-bucket.git
Next, install this app by running the following.
scoop install htmldiff
Binary
Get the latest version from the release page, and download the archive file for your operating system/architecture. Unpack the archive, and put the binary somewhere in your $PATH
.
Usage
$ htmldiff -h
Usage: htmldiff [<option>...] <old html> <new html>
-h display help
-nh
true: use new header, false: use old header (default true)
-o string
output filename (default "diff.html")j
When comparing two html files, you need to choose which header to use. By default, it uses the new header. To use the header of the old html file, set -nh=false
flag. ( -nh
means "use new header". )
Example
htmldiff -o=diff/index.html v1/index.html v2/index.html
If you use the header of v1/index.html
, set -nh=false
flag.
htmldiff -o=diff/index.html -nh=false v1/index.html v2/index.html
How to build
It is recommended to build with the go module.
If you don't use the go module
, you need to go get
the following libraries before building.
- github.com/andybalholm/cascadia
- github.com/documize/html-diff
- github.com/gobuffalo/packr/v2
I would like to take this opportunity to thank the authors of these wonderful libraries and tools. Thank you!
Note
Tool packr2
is used to convert template file template/index.html
to packrd/packed-packr.go
for inclusion in the binary. Tool packr2
is installed as follows.
go get -u github.com/gobuffalo/packr/v2/packr2
For more information, please visit the official website.
License
MIT
Author
kemokemo