diff2html/README.md

68 lines
1.5 KiB
Markdown
Raw Normal View History

2014-08-30 02:54:52 +00:00
# Diff to Html by [rtfpessoa](https://github.com/rtfpessoa)
2014-08-30 22:33:12 +00:00
Diff to Html generates pretty HTML diffs from git word diff output.
2014-08-30 02:54:52 +00:00
## Features
2014-09-14 19:50:17 +00:00
* `line-by-line` and `side-by-side` diff
2014-08-30 02:54:52 +00:00
2014-08-30 22:33:12 +00:00
* char-by-char highlight
2014-08-30 02:54:52 +00:00
* new and old line numbers
2014-08-30 22:33:12 +00:00
* inserted and removed lines
2014-08-30 02:54:52 +00:00
* GitHub like style
2014-09-14 19:50:17 +00:00
## Online Example
2014-08-30 02:54:52 +00:00
2014-09-08 17:15:51 +00:00
> Go to [Diff2HTML](http://rtfpessoa.github.io/diff2html/)
2014-08-30 22:33:12 +00:00
2014-09-08 17:15:51 +00:00
## Distributions
* [WebJar](http://www.webjars.org/)
* [Node Module](https://www.npmjs.org/package/diff2html)
* Manually download and import `diff2html.js` into your page
## How to use
> Pretty Line-by-Line Html From Git Word Diff Output
2014-08-30 22:33:12 +00:00
2014-09-14 19:50:17 +00:00
Diff2Html.getPrettyHtmlFromDiff(exInput)
> Pretty Side-by-Side Html From Git Word Diff Output
Diff2Html.getPrettySideBySideHtmlFromDiff(exInput)
2014-08-30 02:54:52 +00:00
2014-08-30 22:33:12 +00:00
> Intermediate Json From Git Word Diff Output
2014-09-14 19:50:17 +00:00
Diff2Html.getJsonFromDiff(exInput)
2014-08-30 22:33:12 +00:00
2014-09-08 17:15:51 +00:00
> Pretty Line-by-Line Html From Json
2014-08-30 22:33:12 +00:00
2014-09-14 19:50:17 +00:00
Diff2Html.getPrettyHtmlFromJson(exInput)
> Pretty Side-by-Side Html From Json
Diff2Html.getPrettySideBySideHtmlFromJson(exInput)
2014-08-30 02:54:52 +00:00
2014-09-08 17:15:51 +00:00
> Check out the `index.html` for a complete example.
2014-08-30 02:54:52 +00:00
2014-08-30 22:33:12 +00:00
## Contributions
2014-08-30 02:54:52 +00:00
All the contributions are welcome.
To contribute just send a pull request with your feature,fix,... and it will be reviewed asap.
## License
Copyright 2014 Rodrigo Fernandes. Released under the terms of the MIT license.
2014-08-30 22:33:12 +00:00
## Thanks
This project is inspired in [pretty-diff](https://github.com/scottgonzalez/pretty-diff) by [Scott González](https://github.com/scottgonzalez).
2014-08-30 02:54:52 +00:00
---