Add a browser example of usage

Thanks to @dxz6228 for the feedback
This commit is contained in:
Rodrigo Fernandes 2018-06-24 14:38:54 +01:00
parent 0f849d4581
commit 1d01d73e74
No known key found for this signature in database
GPG key ID: F2D4160C30D31DFE

View file

@ -68,6 +68,14 @@ Import the stylesheet and the library code
It will now be available as a global variable named `Diff2Html`.
```js
var diffHtml = Diff2Html.getPrettyHtml(
'<Unified Diff String>',
{inputFormat: 'diff', showFiles: true, matching: 'lines', outputFormat: 'side-by-side'}
);
document.getElementById("destination-elem-id").innerHTML = diffHtml;
```
### Node Module
```js