diff --git a/README.md b/README.md index d62c142a0..3dc0576f7 100644 --- a/README.md +++ b/README.md @@ -14,22 +14,23 @@ their syntax. [Installation](https://difftastic.wilfred.me.uk/installation.html) in [the manual](http://difftastic.wilfred.me.uk/).** -## Basic Example +## Examples -![Screenshot of difftastic and JS](img/js.png) +![Screenshot of difftastic and Rust](img/wrap_expr.png) -In this JavaScript example, we can see: +^ Difftastic understands exactly which pieces of syntax has changed, +and can highlight them in context. -(1) Difftastic understands nesting. It highlights the matching `{` and -`}`, but understands that `foo()` hasn't changed despite the leading -whitespace. +![Screenshot of difftastic and HTML](img/html.png) -(2) Difftastic understands which lines should be aligned. It's aligned -`bar(1)` on the left with `bar(2)` on the right, even though the -textual content isn't identical. +^ Difftastic understands when whitespace matters, and when it's just +an indentation change. -(3) Difftastic understands that line-wrapping isn't -meaningful. `"eric"` is now on a new line, but it hasn't changed. +![Screenshot of difftastic and JS](img/reformat.png) + +^ Difftastic is not line-oriented. If you reformat your code and it's +now split over multiple lines, difftastic will show you what's +actually changed. ## One Minute Demo @@ -74,15 +75,6 @@ merging. ## FAQ -### Isn't this basically `--word-diff --ignore-all-space`? - -Word diffing [can't do -this](https://twitter.com/_wilfredh/status/1510139929971421191/photo/1). - -Difftastic parses your code. It understands when whitespace matters, -such as inside string literals or languages like Python. It understands -that `x-1` is three tokens in JS but one token in Lisp. - ### Can I use difftastic with git? You can! The difftastic manual [includes instructions for git diff --git a/img/html.png b/img/html.png new file mode 100644 index 000000000..5f1c4aa4f Binary files /dev/null and b/img/html.png differ diff --git a/img/js.png b/img/js.png deleted file mode 100644 index 9dabb388b..000000000 Binary files a/img/js.png and /dev/null differ diff --git a/img/reformat.png b/img/reformat.png new file mode 100644 index 000000000..1dfcbec3d Binary files /dev/null and b/img/reformat.png differ diff --git a/img/wrap_expr.png b/img/wrap_expr.png new file mode 100644 index 000000000..6e70cf96a Binary files /dev/null and b/img/wrap_expr.png differ