docdiff 0.6.2 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +27 -49
  3. data/README.md +351 -0
  4. data/README_ja.md +351 -0
  5. data/Rakefile +2 -42
  6. data/bin/docdiff +53 -30
  7. data/{docdiff.conf.example → doc/example/docdiff.conf.example} +4 -3
  8. data/doc/man/docdiff.adoc +146 -0
  9. data/doc/news.md +180 -0
  10. data/doc/shell_completion/_docdiff.zsh +51 -0
  11. data/doc/shell_completion/docdiff.bash +68 -0
  12. data/docdiff.gemspec +1 -0
  13. data/lib/doc_diff.rb +13 -0
  14. data/lib/docdiff/version.rb +1 -1
  15. data/lib/docdiff/view.rb +4 -4
  16. data/test/charstring_test.rb +121 -121
  17. data/test/docdiff_test.rb +1 -1
  18. data/test/document_test.rb +109 -109
  19. data/test/fixture/01_ja_utf8_lf.txt +2 -0
  20. data/test/fixture/02_ja_utf8_lf.txt +2 -0
  21. data/test/view_test.rb +135 -111
  22. metadata +39 -36
  23. data/devutil/changelog.sh +0 -40
  24. data/index.html +0 -181
  25. data/langfilter.rb +0 -10
  26. data/readme.html +0 -750
  27. data/readme.md +0 -185
  28. /data/{docdiffwebui.cgi → doc/example/docdiffwebui.cgi} +0 -0
  29. /data/{docdiffwebui.html → doc/example/docdiffwebui.html} +0 -0
  30. /data/{img/docdiff-screenshot-format-html-digest-firefox.png → doc/img/screenshot-format-html-digest-firefox.png} +0 -0
  31. /data/{img/docdiff-screenshot-format-html-firefox.png → doc/img/screenshot-format-html-firefox.png} +0 -0
  32. /data/{img/docdiff-screenshot-format-tty-cmdexe-en.png → doc/img/screenshot-format-tty-cmdexe-en.png} +0 -0
  33. /data/{img/docdiff-screenshot-format-tty-cmdexe-ja.png → doc/img/screenshot-format-tty-cmdexe-ja.png} +0 -0
  34. /data/{img/docdiff-screenshot-format-tty-rxvtunicode-en.png → doc/img/screenshot-format-tty-rxvtunicode-en.png} +0 -0
  35. /data/{img/docdiff-screenshot-format-tty-rxvtunicode-ja.png → doc/img/screenshot-format-tty-rxvtunicode-ja.png} +0 -0
  36. /data/{img/docdiff-screenshot-format-tty-xterm-en.png → doc/img/screenshot-format-tty-xterm-en.png} +0 -0
  37. /data/{img/docdiff-screenshot-format-tty-xterm-ja.png → doc/img/screenshot-format-tty-xterm-ja.png} +0 -0
  38. /data/{img/docdiff-screenshot-resolution-linewordchar-xterm.png → doc/img/screenshot-resolution-linewordchar-xterm.png} +0 -0
  39. /data/{sample/01.en.ascii.cr → test/fixture/01_en_ascii_cr.txt} +0 -0
  40. /data/{sample/01.en.ascii.crlf → test/fixture/01_en_ascii_crlf.txt} +0 -0
  41. /data/{sample/01.en.ascii.lf → test/fixture/01_en_ascii_lf.txt} +0 -0
  42. /data/{sample/01.ja.eucjp.lf → test/fixture/01_ja_eucjp_lf.txt} +0 -0
  43. /data/{sample/01.ja.sjis.cr → test/fixture/01_ja_sjis_cr.txt} +0 -0
  44. /data/{sample/01.ja.sjis.crlf → test/fixture/01_ja_sjis_crlf.txt} +0 -0
  45. /data/{sample/01.ja.utf8.crlf → test/fixture/01_ja_utf8_crlf.txt} +0 -0
  46. /data/{sample/02.en.ascii.cr → test/fixture/02_en_ascii_cr.txt} +0 -0
  47. /data/{sample/02.en.ascii.crlf → test/fixture/02_en_ascii_crlf.txt} +0 -0
  48. /data/{sample/02.en.ascii.lf → test/fixture/02_en_ascii_lf.txt} +0 -0
  49. /data/{sample/02.ja.eucjp.lf → test/fixture/02_ja_eucjp_lf.txt} +0 -0
  50. /data/{sample/02.ja.sjis.cr → test/fixture/02_ja_sjis_cr.txt} +0 -0
  51. /data/{sample/02.ja.sjis.crlf → test/fixture/02_ja_sjis_crlf.txt} +0 -0
  52. /data/{sample/02.ja.utf8.crlf → test/fixture/02_ja_utf8_crlf.txt} +0 -0
  53. /data/{sample/humpty_dumpty01.ascii.lf → test/fixture/humpty_dumpty01_ascii_lf.txt} +0 -0
  54. /data/{sample/humpty_dumpty02.ascii.lf → test/fixture/humpty_dumpty02_ascii_lf.txt} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75d0326eaf0ebe880d161beb18ccf549b7965ac0e31131b5ed860b942616d66c
4
- data.tar.gz: c30d0a6a0a5cb1520d91ebdae8a0997b3ac364072c212a2be5f651b94f7b458b
3
+ metadata.gz: cde4401e24dbddfd093efe812847c7cc57f12cea257c113bc2625ac2c38361d5
4
+ data.tar.gz: aa7fd969d604d090f16817dcdb09f2f4a1e5218c2063d3467e29929305afdd41
5
5
  SHA512:
6
- metadata.gz: 970b172f3c9e00967a7cb79113367b7036cf900afdf122f25fc36224dc31550626d7f6f8408ad12ff7fff58e0b91d2ff730b26d58f7603d040a8302d399d78b1
7
- data.tar.gz: ac729648506f82b4a462d3657247dce15579a26aa247f9166408f8da9b40ff9567df8dc66f1d56fb4f215c82ffcaaac4940cfdd368adb49b57f05f5ff679e4c0
6
+ metadata.gz: b0f085aa58f164c0b6a0d0cfaec0439df555d37fbe1c8dacd66962ab41084ec93cc6d0d13c3852ca9404d62c3941edc4477261b44f9402d0353b71cd3a3f257c
7
+ data.tar.gz: b5b1bbb4a18524f5d9278f0afac27dc732dde0be686d4b526301219499fa3ef5a073b132a27a4e12a8bbc7bf847c8440c81179453243b1d30190d8901ea05770
data/Makefile CHANGED
@@ -1,26 +1,14 @@
1
- # Warning: this Makefile is obsolete, use Rakefile instead
2
-
3
1
  PRODUCT = docdiff
4
2
  VERSION = $(shell $(RUBY) -r./lib/docdiff/version.rb -e 'Docdiff::VERSION.display')
5
3
  RUBY = ruby
6
4
  TAR_XVCS = tar --exclude=.svn --exclude=.git
5
+ MD2HTML = md2html --full-html
7
6
 
8
- DOCS = ChangeLog readme.en.html readme.ja.html \
9
- index.en.html index.ja.html
10
- DOCSRC = readme.html index.html img sample
7
+ DOCS = doc/README.md doc/README_ja.md doc/README.html doc/README_ja.html doc/news.html doc/man/$(PRODUCT).1
8
+ DOCSRC = README.md README_ja.md doc/news.md doc/img doc/example doc/man/$(PRODUCT).adoc
11
9
  TESTS = test/*_test.rb
12
- DIST = Makefile devutil lib docdiff.conf.example bin/docdiff \
13
- docdiff.gemspec \
14
- docdiffwebui.html docdiffwebui.cgi \
15
- $(DOCSRC) $(DOCS) $(TESTS)
16
- TESTLOGS = $(foreach t,\
17
- $(wildcard test/*_test.rb),\
18
- $(t:test/%_test.rb=%_test.log)) \
19
-
20
- WWWUSER = hisashim,docdiff
21
- WWWSITE = web.sourceforge.net
22
- WWWSITEPATH = htdocs/
23
- WWWDRYRUN = --dry-run
10
+ DIST = $(shell git ls-files)
11
+ SOURCE_DATE_EPOCH = $(shell git show --quiet --format=%ct HEAD)
24
12
 
25
13
  DESTDIR =
26
14
  PREFIX = /usr/local
@@ -28,25 +16,27 @@ datadir = $(DESTDIR)$(PREFIX)/share
28
16
 
29
17
  all: $(DOCS)
30
18
 
31
- testall:
32
- $(MAKE) test RUBY=ruby1.9.1
19
+ test: $(TESTS)
20
+ $(RUBY) -I./lib -e 'ARGV.map{|a| require_relative "#{a}"}' $^
33
21
 
34
- test: $(TESTLOGS)
22
+ docs: $(DOCS)
35
23
 
36
- %_test.log:
37
- $(RUBY) -I./lib test/$*_test.rb | tee $@
24
+ %.html: %.md
25
+ $(MD2HTML) --html-title="$(shell grep '^# .*' $< | head -n 1 | sed 's/^# //')" $< \
26
+ | sed 's/\(href\|src\)="doc\/\([^"]*\)"/\1="\2"/g' \
27
+ | sed 's/href="\([^"]*\).md"/href="\1.html"/g' > $@
38
28
 
39
- docs: $(DOCS)
29
+ doc/%.md: %.md
30
+ cp $^ $@
40
31
 
41
- ChangeLog:
42
- devutil/changelog.sh > $@
32
+ %.1: %.adoc
33
+ SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) asciidoctor --backend=manpage --out-file=$@ $<
43
34
 
44
- readme.%.html: readme.html
45
- $(RUBY) -Ku langfilter.rb --$* $< > $@
46
- index.%.html: index.html
47
- $(RUBY) -Ku langfilter.rb --$* $< > $@
35
+ doc/man/$(PRODUCT).1: doc/man/$(PRODUCT).adoc
36
+ sed 's|/path/to/README.html|$(PREFIX)/share/doc/$(PRODUCT)/README.html|g' $< \
37
+ | SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) asciidoctor --backend=manpage --out-file=$@ -
48
38
 
49
- install: $(DIST)
39
+ install: $(DIST) $(DOCS)
50
40
  @if [ ! -d $(DESTDIR)$(PREFIX)/bin ]; then \
51
41
  mkdir -p $(DESTDIR)$(PREFIX)/bin; \
52
42
  fi
@@ -61,12 +51,13 @@ install: $(DIST)
61
51
  @if [ ! -d $(DESTDIR)/etc/$(PRODUCT) ]; then \
62
52
  mkdir -p $(DESTDIR)/etc/$(PRODUCT); \
63
53
  fi
64
- cp -Pprv docdiff.conf.example $(DESTDIR)/etc/$(PRODUCT)/docdiff.conf
54
+ cp -Pprv doc/example/docdiff.conf.example $(DESTDIR)/etc/$(PRODUCT)/docdiff.conf
65
55
 
66
56
  @if [ ! -d $(datadir)/doc/$(PRODUCT) ]; then \
67
57
  mkdir -p $(datadir)/doc/$(PRODUCT); \
68
58
  fi
69
- cp -Pprv $(DOCSRC) $(DOCS) $(datadir)/doc/$(PRODUCT)
59
+ cp -Pprv $(DOCSRC) $(datadir)/doc/$(PRODUCT)
60
+ cp -Pprv $(DOCS) $(datadir)/doc/$(PRODUCT)
70
61
 
71
62
  uninstall:
72
63
  -rm -fr $(DESTDIR)$(PREFIX)/bin/docdiff
@@ -74,31 +65,18 @@ uninstall:
74
65
  -rm -fr $(DESTDIR)/etc/$(PRODUCT)
75
66
  -rm -fr $(datadir)/doc/$(PRODUCT)
76
67
 
77
- dist: $(DIST)
78
- mkdir $(PRODUCT)-$(VERSION)
79
- cp -rp $(DIST) $(PRODUCT)-$(VERSION)
80
- $(TAR_XVCS) -zvcf $(PRODUCT)-$(VERSION).tar.gz $(PRODUCT)-$(VERSION)
81
- -rm -fr $(PRODUCT)-$(VERSION)
68
+ dist:
69
+ git archive --prefix="$(PRODUCT)-$(VERSION)/" --format=tar HEAD --output="$(PRODUCT)-$(VERSION).tar.gz"
82
70
 
83
71
  gem: $(PRODUCT)-$(VERSION).gem
84
72
  $(PRODUCT)-$(VERSION).gem: $(PRODUCT).gemspec
85
- gem build $<
86
-
87
- wwwupload:
88
- $(MAKE) www WWWDRYRUN=
89
- www: $(DOCSRC) $(DOCS)
90
- rsync $(WWWDRYRUN) -auv -e ssh --delete \
91
- --exclude='.svn' --exclude='.git' \
92
- $(DOCSRC) $(DOCS) \
93
- $(WWWUSER)@$(WWWSITE):$(WWWSITEPATH)
73
+ SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) gem build $<
94
74
 
95
75
  clean:
96
76
  -rm -fr $(DOCS)
97
- -rm -fr $(TESTLOGS)
98
77
 
99
78
  distclean: clean
100
79
  -rm -fr $(PRODUCT)-$(VERSION).tar.gz
101
80
  -rm -fr $(PRODUCT)-$(VERSION).gem
102
81
 
103
- .PHONY: all testall test docs install uninstall dist gem \
104
- wwwupload www clean distclean
82
+ .PHONY: all test docs install uninstall dist gem clean distclean
data/README.md ADDED
@@ -0,0 +1,351 @@
1
+ # DocDiff
2
+
3
+ * English | [Japanese](README_ja.md)
4
+
5
+ (C) 2000 Hisashi MORITA
6
+
7
+ ## Description
8
+
9
+ Compares two text files by word, by character, or by line
10
+
11
+ ## Screenshots
12
+
13
+ <div style="display: grid; grid-template-columns: 1fr 1fr;">
14
+
15
+ <p>HTML output<br />
16
+ <img src="doc/img/screenshot-format-html-firefox.png" alt="HTML output"/></p>
17
+
18
+ <p>HTML output (digest)<br />
19
+ <img src="doc/img/screenshot-format-html-digest-firefox.png" alt="HTML output (digest)" /></p>
20
+
21
+ <p>tty output<br />
22
+ <img src="doc/img/screenshot-format-tty-rxvtunicode-en.png" alt="tty output" /></p>
23
+
24
+ <p>tty output (comparing Japanese text)<br />
25
+ <img src="doc/img/screenshot-format-tty-rxvtunicode-ja.png" alt="tty output (comparing Japanese text)" /></p>
26
+
27
+ <p>tty output<br />
28
+ <img src="doc/img/screenshot-format-tty-xterm-en.png" alt="tty output" /></p>
29
+
30
+ <p>tty output (comparing Japanese text)<br />
31
+ <img src="doc/img/screenshot-format-tty-xterm-ja.png" alt="tty output (comparing Japanese text)" /></p>
32
+
33
+ </div>
34
+
35
+ <p>Comparing English text (codepage 437) on Windows (Cygwin)<br />
36
+ <img src="doc/img/screenshot-format-tty-cmdexe-en.png" alt="Comparing English text (codepage 437) on Windows (Cygwin)" /></p>
37
+
38
+ <p>Comparing Japanese text (codepage 932) on Windows (Cygwin)<br />
39
+ <img src="doc/img/screenshot-format-tty-cmdexe-ja.png" alt="Comparing Japanese text (codepage 932) on Windows (Cygwin)" /></p>
40
+
41
+ <p>You can compare text files by line, word, or character (format: tty)<br/>
42
+ <img src="doc/img/screenshot-resolution-linewordchar-xterm.png" alt="You can compare text files by line, word, or character (format: tty)" /></p>
43
+
44
+ (Screenshots as of version 0.3.2.)
45
+
46
+ ## Summary
47
+
48
+ DocDiff compares two text files and shows the difference. It can compare files word by word, character by character, or line by line. It has several output formats such as HTML, tty, Manued, or user-defined markup.
49
+
50
+ It supports several encodings and end-of-line characters, including ASCII (and other single byte encodings such as ISO-8859-*), UTF-8, EUC-JP, Shift_JIS (Windows-31J), CR, LF, and CRLF.
51
+
52
+ ## Usage
53
+
54
+ ### Synopsis
55
+
56
+ ```
57
+ $ docdiff [options] oldfile newfile
58
+ ```
59
+
60
+ e.g.
61
+
62
+ ```
63
+ $ docdiff old.txt new.txt > diff.html
64
+ ```
65
+
66
+ See the help message for detail (`docdiff --help`).
67
+
68
+ ### Example
69
+
70
+ <pre>
71
+ $ cat 01_en_ascii_lf.txt
72
+ Hello, my name is Watanabe.
73
+ I am just another Ruby porter.
74
+ $ cat 02_en_ascii_lf.txt
75
+ Hello, my name is matz.
76
+ It's me who has created Ruby. I am a Ruby hacker.
77
+ $ docdiff --tty 01_en_ascii_lf.txt 02_en_ascii_lf.txt
78
+ Hello, my name is <span class="before-change" style="background: yellow; border: thin inset;"><del>Watanabe.</del></span><span class="after-change" style="background: lime; font-weight: bolder; border: thin outset;"><ins>matz.</ins></span>
79
+ <span class="add" style="background: deepskyblue; font-weight: bolder; border: thin outset;"><ins>It's me who has created Ruby.&nbsp;&nbsp;</ins></span>I am <span class="before-change" style="background: yellow; border: thin inset;"><del>just another </del></span><span class="after-change" style="background: lime; font-weight: bolder; border: thin outset;"><ins>a </ins></span>Ruby <span class="before-change" style="background: yellow; border: thin inset;"><del>porter.</del></span><span class="after-change" style="background: lime; font-weight: bolder; border: thin outset;"><ins>hacker.</ins></span>
80
+ $
81
+ </pre>
82
+
83
+ ## Requirements
84
+
85
+ * Runtime requirements:
86
+ - [Ruby](https://www.ruby-lang.org/) (>= 3.0)
87
+ * Development requirements:
88
+ - Make ([GNU Make](https://www.gnu.org/software/make/))
89
+ - [Git](https://git-scm.com/)
90
+ - [md2html](https://github.com/mity/md4c) (for generating documents)
91
+ - [Rake](https://ruby.github.io/rake/) (optional)
92
+ - sed, gzip, tar, etc.
93
+
94
+ ## Installation
95
+
96
+ Several operating environments have a packaged version of DocDiff available. If this applies to you, installing DocDiff via these packages is probably the easiest option.
97
+
98
+ ### Debian Package
99
+
100
+ Site-wide installation:
101
+
102
+ ```
103
+ $ sudo apt update
104
+ $ sudo apt install docdiff
105
+ ```
106
+
107
+ ### Gem Package
108
+
109
+ If you are familiar with the Ruby programming language, you may prefer to install DocDiff as a gem package.
110
+
111
+ User-wide installation from [RubyGems.org](https://rubygems.org/):
112
+
113
+ ```
114
+ $ gem install docdiff
115
+ ```
116
+
117
+ User-wide installation from local build:
118
+
119
+ ```
120
+ $ rake build
121
+ $ gem install pkg/docdiff-X.Y.Z.gem
122
+ ```
123
+
124
+ (Note that you have to set the `PATH` environment variable correctly to run applications that are installed as gems. Environment management tools for Ruby such as [rbenv](https://github.com/rbenv/rbenv) may come in handy.)
125
+
126
+ ### Installation from Source Using Make
127
+
128
+ If you really have to install DocDiff from source using Make, test it carefully before proceeding.
129
+
130
+ Test installation in `tmp` directory:
131
+
132
+ ```
133
+ $ mkdir tmp
134
+ $ make install DESTDIR=tmp PREFIX=/local
135
+ $ tree tmp || la -lR tmp
136
+ ```
137
+
138
+ User-wide installation example (not recommended though, as this may overwrite files and mess up your directory structure):
139
+
140
+ ```
141
+ $ make install DESTDIR=~ PREFIX=/local
142
+ ```
143
+
144
+ ## Configuration
145
+
146
+ You can place configuration files at:
147
+
148
+ * `/etc/docdiff/docdiff.conf` (site-wide configuration)
149
+
150
+ * `~/.config/docdiff/docdiff.conf` (user configuration) (see [`$XDG_CONFIG_HOME`](https://specifications.freedesktop.org/basedir/0.8/))
151
+
152
+ (Warning: You are discouraged from using either `~/etc/docdiff/docdiff.conf` or `~/.docdiff/docdiff.conf`, both of which are deprecated though they are still effective for backward compatibility at the moment. Also note that multiple user configuration files cannot coexist at the same time.)
153
+
154
+ Notation is as follows (also refer to the file `docdiff.conf.example` included in the distribution archive):
155
+
156
+ ```
157
+ # comment
158
+ key1 = value
159
+ key2 = value
160
+ ...
161
+ ```
162
+
163
+ Every value is treated as string, unless it seems like a number. In such case, value is treated as a number (usually an integer).
164
+
165
+ ## Troubleshooting and Tips
166
+
167
+ ### Wrong argument type nil (expected Module) (TypeError)
168
+
169
+ Sometimes DocDiff fails to auto-recognize encoding and/or end-of-line characters. You may get an error like this.
170
+
171
+ ```
172
+ charstring.rb:47:in `extend': wrong argument type nil (expected Module) (TypeError)
173
+ ```
174
+
175
+ In such a case, try explicitly specifying encoding and end-of-line character (e.g. `docdiff --utf8 --crlf`).
176
+
177
+ ### Inappropriate Insertions and Deletions
178
+
179
+ When comparing space-separated text (such as English or program source code), the word next to the end of line may be sometimes unnecessarily deleted and inserted. This is due to the limitation of DocDiff's word splitter. It splits strings into words like the following.
180
+
181
+ * Text 1:
182
+ ```
183
+ foo bar
184
+ ```
185
+ (`"foo bar" => ["foo ", "bar"]`)
186
+
187
+ * Text 2:
188
+ ```
189
+ foo
190
+ bar
191
+ ```
192
+ (`"foo\nbar" => ["foo", "\n", "bar"]`)
193
+
194
+ * Comparison result:
195
+ <pre>
196
+ <del>foo </del><ins>foo</ins><ins>
197
+ </ins>bar
198
+ </pre>
199
+ (`"<del>foo </del><ins>foo</ins><ins>\n</ins>bar"`)
200
+
201
+ Foo is (unnecessarily) deleted and inserted at the same time.
202
+
203
+ I would like to fix this sometime, but it's not easy. If you split single space as single element (i.e. `["foo", " ", "bar"]`), the word order of the comparison result will be less natural. Suggestions are welcome.
204
+
205
+ ### Using DocDiff with Version Control Systems
206
+
207
+ If you want to use DocDiff as an external diff program from VCSs, the following may work.
208
+
209
+ * Git:
210
+ ```
211
+ $ GIT_EXTERNAL_DIFF=~/bin/gitdocdiff.sh git diff
212
+ ```
213
+ `~/bin/gitdocdiff.sh`:
214
+ ```
215
+ #!/bin/sh
216
+ docdiff --ascii --lf --tty --digest $2 $5
217
+ ```
218
+
219
+ * Subversion:
220
+ ```
221
+ $ svn diff --diff-cmd=docdiff --extensions "--ascii --lf --tty --digest"
222
+ ```
223
+
224
+ (Sometimes just `git diff --word-diff-regex="\w"` suffices though.)
225
+
226
+ With zsh, you can use DocDiff or other utility to compare arbitrary sources. In the following example, we compare specific revision of foo.html in a repository with one on a website.
227
+
228
+ * Git:
229
+ ```
230
+ $ docdiff --tty --digest =(git show abc1234:foo.html) =(git show def4567:foo.html)
231
+ ```
232
+
233
+ * Subversion:
234
+ ```
235
+ $ docdiff =(svn cat -r3 http://svn.example.org/repos/foo.html) =(curl --silent http://www.example.org/foo.html)
236
+ ```
237
+
238
+ ### Comparing Non-plain Text Document Files
239
+
240
+ You may be able to compare document files other than plain text, if you use appropriate converters.
241
+
242
+ * Comparing the text in two PDF documents:
243
+ ```
244
+ $ docdiff =(pdftotext foo.pdf -) =(pdftotext bar.pdf -)
245
+ ```
246
+
247
+ * Comparing the text in two HTML documents (without tags):
248
+ ```
249
+ $ docdiff =(w3m -dump -cols 10000 foo.html) =(w3m -dump -cols 10000 http://www.example.org/foo.html)
250
+ ```
251
+
252
+ * Comparing the text in two Microsoft Word documents:
253
+ ```
254
+ $ docdiff =(wvWare foo.doc | w3m -T text/html -dump -cols 10000) =(wvWare bar.doc | w3m -T text/html -dump -cols 10000)
255
+ ```
256
+
257
+ ### Workaround for Latin-* (ISO-8859-*) Encodings: Use ASCII
258
+
259
+ If you want to compare Latin-* (ISO-8859-*) text files, try using `ASCII` as their encoding. When `ASCII` is specified, DocDiff assumes single-byte characters.
260
+
261
+ * Comparing Latin-1 text:
262
+ ```
263
+ $ docdiff --encoding=ASCII latin-1-old.txt latin-1-new.txt
264
+ ```
265
+
266
+ ## License
267
+
268
+ This software is distributed under so-called modified BSD style license (<http://www.opensource.org/licenses/bsd-license.php>) (without advertisement clause)). By contributing to this software, you agree that your contribution may be incorporated under the same license.
269
+
270
+ Copyright and condition of use of main portion of the source:
271
+
272
+ ```
273
+ Copyright (C) Hisashi MORITA. All rights reserved.
274
+
275
+ Redistribution and use in source and binary forms, with or without
276
+ modification, are permitted provided that the following conditions
277
+ are met:
278
+ 1. Redistributions of source code must retain the above copyright
279
+ notice, this list of conditions and the following disclaimer.
280
+ 2. Redistributions in binary form must reproduce the above copyright
281
+ notice, this list of conditions and the following disclaimer in the
282
+ documentation and/or other materials provided with the distribution.
283
+ 3. Neither the name of the University nor the names of its contributors
284
+ may be used to endorse or promote products derived from this software
285
+ without specific prior written permission.
286
+
287
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
288
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
289
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
290
+ ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
291
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
292
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
293
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
294
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
295
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
296
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
297
+ SUCH DAMAGE.
298
+ ```
299
+
300
+ Diff library (`lib/docdiff/diff.rb` and `lib/docdiff/diff/*`) was originally a part of Ruby/CVS by Akira TANAKA. Ruby/CVS is licensed under modified BSD style license. See the following for detail.
301
+
302
+ * <http://raa.ruby-lang.org/list.rhtml?name=ruby-cvs>
303
+ * <http://cvs.m17n.org/~akr/ruby-cvs/>
304
+
305
+ ## Credits
306
+
307
+ * Hisashi MORITA (author)
308
+
309
+ ## Acknowledgments
310
+
311
+ * Akira TANAKA (diff library author)
312
+ * Shin'ichiro HARA (initial idea and algorithm suggestion)
313
+ * Masatoshi SEKI (patch)
314
+ * Akira YAMADA (patch, Debian package)
315
+ * Kenshi MUTO (testing, bug report, Debian package)
316
+ * Kazuhiro NISHIYAMA (bug report)
317
+ * Hiroshi OHKUBO (bug report)
318
+ * Shugo MAEDA (bug report)
319
+ * Kazuhiko (patch)
320
+ * Shintaro Kakutani (patches)
321
+ * Masayoshi Takahashi (patches)
322
+ * Masakazu Takahashi (patch)
323
+ * Hibariya (bug report)
324
+ * Hiroshi SHIBATA (patch)
325
+ * Tamotsu Takahashi (patches)
326
+ * MIKAMI Yoshiyuki (patch)
327
+
328
+ Excuse us this list is far from complete and fails to acknowledge many more who have helped us somehow. We really appreciate it.
329
+
330
+ ## Resources
331
+
332
+ ### Formats
333
+
334
+ * [HTML/XHTML](https://www.w3.org/)
335
+ * tty (Graphic rendition using VT100 / ANSI escape sequences)
336
+ - [VT100](https://vt100.net/docs/tp83/appendixb.html)
337
+ - [ANSI](https://tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html)
338
+ * [Manued](https://sundayresearch.eu/hitoshi/otherprojects/manued/) ([in Japanese](https://sundayresearch.eu/hitoshi/otherprojects/manued/index-j.html)) (Manuscript Editing Language: a proofreading method for text)
339
+
340
+ ### Software with Similar Features
341
+
342
+ There are many other software that can compare text word by word and/or character by character.
343
+
344
+ * CLI:
345
+ - [wdiff](https://www.gnu.org/software/wdiff/) (requires spaces between words)
346
+ - cdif / [sdif-tools](https://github.com/kaz-utashiro/sdif-tools)
347
+ * GUI:
348
+ - [WinMerge](https://winmerge.org/) (Windows)
349
+ * Editor extensions:
350
+ - [ediff](https://www.gnu.org/software/emacs/manual/html_mono/ediff.html) (Emacs)
351
+ - [diff-detail](http://ohkubo.s53.xrea.com/xyzzy/index.html#diff-detail) ([xyzzy](https://github.com/xyzzy-022/xyzzy))