@@ -54,50 +54,53 @@ Diff to Html generates pretty HTML diffs from unified and git diff output in you
5454
5555## Usage
5656
57- Usage: diff2html [options] -- [diff args]
58-
59- Options:
60- -s, --style Output style [choices: "line", "side"] [default: "line"]
61- --sc, --synchronisedScroll Synchronised horizontal scroll [choices: "enabled", "disabled"] [default: "enabled"]
62- --su, --summary Show files summary [choices: "closed", "open", "hidden"] [default: "closed"]
63- --lm, --matching Diff line matching type [choices: "lines", "words", "none"] [default: "none"]
64- --lmt, --matchWordsThreshold Diff line matching word threshold [default: "0.25"]
65- --lmm, --matchingMaxComparisons Diff line matching maximum line comparisons of a block of changes [default: 2500]
66- --hwt, --htmlWrapperTemplate Path to custom template to be rendered when using the "html" output format [string]
67- -f, --format Output format [choices: "html", "json"] [default: "html"]
68- -d, --diff Diff style [choices: "word", "char"] [default: "word"]
69- -i, --input Diff input source [choices: "file", "command", "stdin"] [default: "command"]
70- -o, --output Output destination [choices: "preview", "stdout"] [default: "preview"]
71- -u, --diffy Upload to diffy.org [choices: "browser", "pbcopy", "print"]
72- -F, --file Send output to file (overrides output option) [string]
73- --version Show version number
74- -h, --help Show help
75-
76- Examples:
77- diff2html -s line -f html -d word -i command -o preview -- -M HEAD~1
78- -> diff last commit, line by line, word comparison between lines,previewed
79- in the browser and input from git diff command
80- diff2html -i file -- my-file-diff.diff
81- -> reading the input from a file
82- diff -u file1.txt file2.txt | diff2html -i stdin
83- -> reading diff from stdin
84- diff2html -f json -o stdout -- -M HEAD~1
85- -> print json format to stdout
86- diff2html -F my-pretty-diff.html -- -M HEAD~1
87- -> print to file
88- diff2html -F my-pretty-diff.html --hwt my-custom-template.html -- -M HEAD~1
89- -> print to file using custom markup
90- templates can include the following variables:
91- `<!--diff2html-css-->` - writes default CSS to page
92- `<!--diff2html-js-ui-->` - writes default JavaScript UI scripts to page
93- `//diff2html-fileListCloseable` - writes code to support selected list interaction, must be within a <script> block
94- `//diff2html-synchronisedScroll` - writes code to support selected scroll interaction, must be within a <script> block
95- `<!--diff2html-diff-->` - writes diff content to page
96-
97- © 2014-2016 rtfpessoa
98- For support, check out https://github.com/rtfpessoa/diff2html-cli
99-
100- > NOTE: notice the ` -- ` in the examples
57+ Usage: diff2html [ options] -- [ diff args]
58+
59+ | flag | alias | description | choices | default |
60+ | --- | --- | --- | --- | --- |
61+ | -s | --style | Output style | ` line ` , ` side ` | ` line ` |
62+ | --sc | --synchronisedScroll | Synchronised horizontal scroll | ` enabled ` , ` disabled ` | ` enabled ` |
63+ | --su | --summary | Show files summary | ` closed ` , ` open ` , ` hidden ` | ` closed ` |
64+ | --lm | --matching | Diff line matching type | ` lines ` , ` words ` , ` none ` | ` none ` |
65+ | --lmt | --matchWordsThreshold | Diff line matching word threshold | | ` 0.25 ` |
66+ | --lmm | --matchingMaxComparisons | Diff line matching maximum line comparisons of a block of changes | ` 2500 ` |
67+ | --hwt | --htmlWrapperTemplate | Path to custom template to be rendered when using the ` html ` output format | _ [ string] _ |
68+ | -f | --format | Output format | ` html ` , ` json ` | ` html ` |
69+ | -d | --diff | Diff style | ` word ` , ` char ` | ` word ` |
70+ | -i | --input | Diff input source | ` file ` , ` command ` , ` stdin ` | ` command ` |
71+ | -o | --output | Output destination | ` preview ` , ` stdout ` | ` preview ` |
72+ | -u | --diffy | Upload to diffy.org | ` browser ` , ` pbcopy ` , ` print ` | |
73+ | -F | --file | Send output to file (overrides output option) | _ [ string] _ | |
74+ | --version | | Show version number | | |
75+ | -h | --help | Show help | | |
76+
77+ Examples:
78+
79+ ` diff2html -s line -f html -d word -i command -o preview -- -M HEAD~1 `
80+ - diff last commit, line by line, word comparison between lines, previewed in the browser and input from git diff command
81+
82+ ` diff2html -i file -- my-file-diff.diff `
83+ - reading the input from a file
84+
85+ ` diff -u file1.txt file2.txt | diff2html -i stdin `
86+ - reading diff from stdin
87+
88+ ` diff2html -f json -o stdout -- -M HEAD~1 `
89+ - print json format to stdout
90+
91+ ` diff2html -F my-pretty-diff.html -- -M HEAD~1 `
92+ - print to file
93+
94+ ` diff2html -F my-pretty-diff.html --hwt my-custom-template.html -- -M HEAD~1 `
95+ - print to file using custom markup templates can include the following variables:
96+ - ` <!--diff2html-css--> ` - writes default CSS to page
97+ - ` <!--diff2html-js-ui--> ` - writes default JavaScript UI scripts to page
98+ - ` //diff2html-fileListCloseable ` - writes code to support selected list interaction, must be within a ` <script> ` block
99+ - ` //diff2html-synchronisedScroll ` - writes code to support selected scroll interaction, must be within a ` <script> ` block
100+ - ` <!--diff2html-diff--> ` - writes diff content to page
101+
102+
103+ _ NOTE_ : notice the ` -- ` in the examples
101104
102105## Contributions
103106
@@ -107,7 +110,7 @@ I will try to review them as soon as possible.
107110
108111## License
109112
110- Copyright 2014-2016 Rodrigo Fernandes. Released under the terms of the MIT license.
113+ Copyright 2014-2019 Rodrigo Fernandes. Released under the terms of the MIT license.
111114
112115## Thanks
113116
0 commit comments