From bc269c9a3bce50f61a2bfedf5a70755d9d58058d Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 26 Oct 2017 02:23:41 -0700 Subject: [PATCH] Updating readme. --- README.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f2987e..e8d4343 100644 --- a/README.md +++ b/README.md @@ -8,19 +8,40 @@ string chunks. ```lua make_diff = require "diff" s1 = [[hello +... to the world]] s2 = [[hello +... at the world]] diff = make_diff(s1, s2) +``` + +returns the table: + +``` +{ + {old="hello\n...\n", old_line=1, old_line_end=2, + new="hello\n...\n", new_line=1, new_line_end=2}, + {old="to the\n", old_line=3, old_line_end=3, + new="at the\n", new_line=3, new_line_end=3}, + {old="world", old_line=4, old_line_end=4, + new="world", new_line=4, new_line_end=4}, +} +``` + +and running: + +```lua diff:print{color=false} ``` -Produces: +produces the output: ``` hello + ... - to the + at the world