@@ -24,8 +24,8 @@ Diff to Html generates pretty HTML diffs from unified and git diff output in you
24
24
- [ Setup] ( #setup )
25
25
- [ Usage] ( #usage )
26
26
- [ Custom HTML wrapper template] ( #custom-html-wrapper-template )
27
- - [ Examples: ] ( #examples )
28
- - [ Contributions ] ( #contributions )
27
+ - [ Examples] ( #examples )
28
+ - [ Contribute ] ( #contribute )
29
29
- [ Developing] ( #developing )
30
30
- [ License] ( #license )
31
31
- [ Thanks] ( #thanks )
@@ -61,29 +61,31 @@ Diff to Html generates pretty HTML diffs from unified and git diff output in you
61
61
62
62
## Setup
63
63
64
- npm install -g diff2html-cli
64
+ ``` sh
65
+ npm install -g diff2html-cli
66
+ ```
65
67
66
68
## Usage
67
69
68
- Usage: diff2html [ options] -- [ diff args ]
70
+ Usage: diff2html [ flags and/or options ] -- [ git diff passthrough flags and options ]
69
71
70
72
| flag | alias | description | choices | default |
71
73
| ----- | ------------------------ | -------------------------------------------------------------------------- | ---------------------------- | --------- |
72
74
| -s | --style | Output style | ` line ` , ` side ` | ` line ` |
73
75
| --sc | --synchronisedScroll | Synchronised horizontal scroll | ` true ` , ` false ` | ` true ` |
74
76
| --hc | --highlightCode | Highlight code | ` true ` , ` false ` | ` true ` |
75
77
| --su | --summary | Show files summary | ` closed ` , ` open ` , ` hidden ` | ` closed ` |
76
- | --d | --diffStyle | Diff style | ` word ` , ` char ` | ` word ` |
78
+ | -d | --diffStyle | Diff style | ` word ` , ` char ` | ` word ` |
77
79
| --lm | --matching | Diff line matching type | ` lines ` , ` words ` , ` none ` | ` none ` |
78
80
| --lmt | --matchWordsThreshold | Diff line matching word threshold | | ` 0.25 ` |
79
81
| --lmm | --matchingMaxComparisons | Diff line matching maximum line comparisons of a block of changes | ` 2500 ` |
80
- | --hwt | --htmlWrapperTemplate | Path to custom template to be rendered when using the ` html ` output format | _ [ string] _ |
82
+ | --hwt | --htmlWrapperTemplate | Path to custom template to be rendered when using the ` html ` output format | ` [string] ` |
81
83
| -f | --format | Output format | ` html ` , ` json ` | ` html ` |
82
84
| -i | --input | Diff input source | ` file ` , ` command ` , ` stdin ` | ` command ` |
83
85
| -o | --output | Output destination | ` preview ` , ` stdout ` | ` preview ` |
84
86
| -u | --diffy | Upload to diffy.org | ` browser ` , ` pbcopy ` , ` print ` | |
85
- | -F | --file | Send output to file (overrides output option) | _ [ string] _ | |
86
- | --ig | --ignore | Ignore particular files from the diff | _ [ string] _ | |
87
+ | -F | --file | Send output to file (overrides output option) | ` [string] ` | |
88
+ | --ig | --ignore | Ignore particular files from the diff | ` [string] ` | |
87
89
| -v | --version | Show version number | | |
88
90
| -h | --help | Show help | | |
89
91
@@ -97,13 +99,13 @@ they are here:
97
99
98
100
- Inside the ` <head> ` tag
99
101
100
- ```
102
+ ``` html
101
103
<link rel =" stylesheet" href =" https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/styles/github.min.css" />
102
104
<!-- diff2html-css-->
103
105
<!-- diff2html-js-ui-->
104
106
<script >
105
- document.addEventListener(" DOMContentLoaded" , () => {
106
- const targetElement = document.getElementById(" diff" );
107
+ document .addEventListener (' DOMContentLoaded' , () => {
108
+ const targetElement = document .getElementById (' diff' );
107
109
const diff2htmlUi = new Diff2HtmlUI (targetElement);
108
110
// diff2html-fileListToggle
109
111
// diff2html-synchronisedScroll
@@ -114,13 +116,13 @@ they are here:
114
116
115
117
- Inside the ` <body> ` tag
116
118
117
- ```
119
+ ``` html
118
120
<div id =" diff" >
119
121
<!-- diff2html-diff-->
120
122
</div >
121
123
```
122
124
123
- ### Examples:
125
+ ### Examples
124
126
125
127
` diff2html -s line -f html -d word -i command -o preview -- -M HEAD~1 `
126
128
@@ -153,7 +155,7 @@ they are here:
153
155
154
156
_ NOTE_ : notice the ` -- ` in the examples
155
157
156
- ## Contributions
158
+ ## Contribute
157
159
158
160
This is a developer friendly project, all the contributions are welcome. To contribute just send a pull request with
159
161
your changes following the guidelines described in ` CONTRIBUTING.md ` . I will try to review them as soon as possible.
@@ -164,7 +166,7 @@ Make some changes, `yarn build` and then `./bin/diff2html` 😉
164
166
165
167
## License
166
168
167
- Copyright 2014-2019 Rodrigo Fernandes. Released under the terms of the MIT license.
169
+ Copyright 2014-present Rodrigo Fernandes. Released under the terms of the MIT license.
168
170
169
171
## Thanks
170
172
0 commit comments