Skip to content

Commit 9ed97da

Browse files
fredemmottfacebook-github-bot
authored andcommitted
Add examples to README
Summary: Pull Request resolved: hhvm#6 Differential Revision: D10032172 fbshipit-source-id: 64610581e5c4271714a3093be015d53d6b37b8ce
1 parent dfee5eb commit 9ed97da

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

README.md

+17-3
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,28 @@ element (i.e. it's unchanged in both sequences), insert an element, or delete an
99
element. For example, in a unified diff, these would be:
1010

1111
```diff
12-
DiffKeepOp
13-
- DiffDeleteOp
14-
+ DiffInsertOp
12+
DiffKeepOp
13+
-DiffDeleteOp
14+
+DiffInsertOp
1515
```
1616

1717
String diffs are typically represented as a sequence of lines, but can also be
1818
represented as a sequence of characters, allowing intra-line diffs.
1919

20+
## Diff output formats
21+
22+
difflib can create standard unified diffs:
23+
24+
![@@ -1 +1@@ -Foo Bat Baz +Foo Bar Baz](udiff.png)
25+
26+
difflib can also create colored diffs, with intra-line edits highlighted:
27+
28+
![same diff as above, but with 'Bat' highlighted red, 'Bar' highlighted
29+
green](clidiff.png)
30+
31+
A concrete implementation is provided for standard CLI terminals, and an
32+
abstract base class for other implementations, such as HTML or XHP.
33+
2034
## Examples
2135

2236
```Hack

clidiff.png

6.51 KB
Loading

udiff.png

5.55 KB
Loading

0 commit comments

Comments
 (0)