Add a browser example of usage
Thanks to @dxz6228 for the feedback
This commit is contained in:
parent
0f849d4581
commit
1d01d73e74
1 changed files with 8 additions and 0 deletions
|
|
@ -68,6 +68,14 @@ Import the stylesheet and the library code
|
||||||
|
|
||||||
It will now be available as a global variable named `Diff2Html`.
|
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
|
### Node Module
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue