1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>DocDiff Readme</title>
<style type="text/css">
body {
margin-left: 5%;
}
body > h1, body > h2 {
margin-left: -5%;
}
h1 {
border: medium outset;
padding: 0.5em;
}
h2 {
border-top: thin solid;
border-right: thin solid;
border-left: thick solid;
border-bottom: thin solid;
padding-left: 0.3em;
}
h3 {
border-left: thick solid;
padding-left: 0.3em;
}
/* these styles are not supported or do not fit to today's browsers.
h4 {display: run-in;}
h4:after {content: ": ";}
kbd {font-family: "Courier New", "Courier", monospace; font-weight: bolder;}
*/
</style>
<style type="text/css">
li blockquote {margin-top: 0em; margin-bottom: 0em; padding-top: 0em; padding-bottom: 0em;}
li blockquote p {margin-top: 0em; margin-bottom: 0em; padding-top: 0em; padding-bottom: 0em;}
span.del {background: hotpink; border: thin inset;}
span.add {background: deepskyblue; font-weight: bolder; border: thin outset;}
span.before-change {background: yellow; border: thin inset;}
span.after-change {background: lime; font-weight: bolder; border: thin outset;}
li.entry .position {font-weight: bolder; margin-top: 0em; margin-bottom: 0em; padding-top: 0em; padding-bottom: 0em;}
li.entry .body {margin-top: 0em; margin-bottom: 0em; padding-top: 0em; padding-bottom: 0em;}
</style>
<style title="en" type="text/css">
* [lang="ja"] {display: none}
* [lang="en"] {display: compact}
</style>
<style title="ja" type="text/css">
* [lang="en"] {display: none}
* [lang="ja"] {display: compact}
</style>
</head>
<body>
<h1>DocDiff Readme</h1>
<p>
(C) 2000 Hisashi MORITA
</p>
<hr />
<h2>
<span lang="en">Table of Contents</span>
<span lang="ja">目次</span>
</h2>
<ul lang="en">
<li><a href="#news">News</a></li>
<li><a href="#todo">Todo</a></li>
<li><a href="#description">Description</a></li>
<li><a href="#summary">Summary</a></li>
<li><a href="#requirement">Requirement</a></li>
<li><a href="#installation">Installation</a></li>
<li><a href="#usage">Usage</a></li>
<li><a href="#tips">Troubleshooting and Tips</a></li>
<li><a href="#license">License</a></li>
<li><a href="#credits">Credits</a></li>
<li><a href="#acknowledgments">Acknowledgments</a></li>
<li><a href="#resources">Resources</a></li>
</ul>
<ul lang="ja">
<li><a href="#news">ニュース</a></li>
<li><a href="#todo">予定</a></li>
<li><a href="#description">簡単な説明</a></li>
<li><a href="#summary">概要</a></li>
<li><a href="#requirement">必要なもの</a></li>
<li><a href="#installation">インストール方法</a></li>
<li><a href="#usage">使い方</a></li>
<li><a href="#tips">問題解決とヒント</a></li>
<li><a href="#license">ライセンス</a></li>
<li><a href="#credits">クレジット</a></li>
<li><a href="#acknowledgments">謝辞</a></li>
<li><a href="#resources">情報源</a></li>
</ul>
<hr />
<h2 id="news">
<span lang="en">News</span>
<span lang="ja">ニュース</span>
</h2>
<ul>
<!--
<li>x.y.z (xxxx-xx-xx)<ul>
<li></li>
</ul></li>
-->
<li>0.6.1 (2021-06-07)<ul>
<li>Update information in .gemspec.</li>
</ul></li>
<li>0.6.0 (2020-07-10)<ul>
<li>User-visible changes:<ul>
<li>Drop support for Ruby 1.8 (thanks to takahashim).</li>
<li>Fix various encoding problems (thanks to takahashim).</li>
<li>Add CP932 (Windows-31J) support through a new option <code>--cp932</code> (thanks to emasaka).</li>
<li>Introduce readme.md, which will obsolete readme.html eventually (thanks to takahashim).</li>
</ul></li>
<li>Developer-related changes:<ul>
<li>Use Mutex#synchronize instead of Thread.exclusive (thanks to hsbt).</li>
<li>Remove JIS0208.TXT to comply with its terms of use (thanks to kmuto).</li>
<li>Introduce top-level class DocDiff to avoid name conflict (thanks to hibariya).</li>
</ul></li>
</ul></li>
<li>0.5.0 (2011-08-12)<ul>
<li>Gemify. Now you can download docdiff via rubygems.org.</li>
<li>Fix failing test on ruby1.9.2-p290.</li>
</ul></li>
<li>0.4.0 (2011-02-23)<ul>
<li>Compatible with Ruby 1.9 (thanks to Kazuhiko).</li>
</ul></li>
<li>0.3.4 (2007-12-10)<ul>
<li>Increased context length in digest mode from 16 to 32.</li>
<li>Added --display=inline|multi option. With inline, things before change and things after change are displayed inline. With multi, they are displayed in separate blocks. Default is inline.</li>
<li>Added --iso8859x option as an alias to --encoding=ASCII, so that users notice DocDiff can handle text in ISO-8859-* encoding.</li>
</ul></li>
<li>0.3.3 (2006-02-03)<ul>
<li>Fixed arg test so that we can compare non-normal files, such as device files and named pipes (thanks to Shugo Maeda).</li>
<li>Added DocDiff Web UI sample (experimental).</li>
<li>Fixed HTML output to produce valid XHTML (thanks to Hiroshi OHKUBO). Note that CSS in HTML output is slightly changed.</li>
<li>Replaced underscores(_) in CSS class names to hyphens(-) so that older UAs can understand them (thanks to Kazuhiro NISHIYAMA).</li>
</ul></li>
<li>0.3.2 (2005-01-03)<ul>
<li>Readme is multilingualized (added partial Japanese translation). Try switching CSS between en and ja. Monolingual files are also available (readme.en.html, readme.ja.html).</li>
<li>Outputs better error messages when it failed to auto-detect the encoding and/or eol, though the accuracy is the same.</li>
<li>Switched revision control system from CVS to Subversion.</li>
</ul></li>
<li>0.3.1 (2004-08-29)<ul>
<li>Added -L (--label) option place holder in order to be used as external diff program from Subversion.</li>
</ul></li>
<li>0.3.0 (2004-05-29)<ul>
<li>Re-designed and re-written from scratch.</li>
<li>Supports multiple encodings (ASCII, EUC-JP, Shift_JIS, UTF-8) and multiple eols (CR, LF, CRLF).</li>
<li>Supports more output formats (tty, HTML, Manued, wdiff-like, user-defined markup text).</li>
<li>Supports configuration files (/etc/docdiff/docdiff.conf, ~/etc/docdiff/docdiff.conf (or ~/.docdiff/docdiff.conf)).</li>
<li>Introduced digest (summary) mode.</li>
<li>Approximately 200% faster than older versions, thanks to akr's diff library.</li>
<li>Better documentation and help message.</li>
<li>License changed from Ruby's to modified BSD style.</li>
<li>Pure Ruby. Does not require external diff program such as GNU diff, or morphological analyzer such as ChaSen.</li>
<li>Runs on both Unix and Windows (tested on Debian GNU/Linux and Cygwin)</li>
<li>Unit tests introduced to decrease bugs and to encourage faster development.</li>
<li>Makefile introduced.</li>
</ul></li>
<li>0.1.8 (2003-12-14)<ul>
<li>Displays warning when --bymorpheme is specified but ChaSen is not available (patch by Akira YAMADA: Debian bug #192258).</li>
<li>Supports system-wide configuration file (if ~/.chasenrc.docdiff does not exist, reads /etc/docdiff/chasenrc) (patch by Akira YAMADA: Debian bug #192261).</li>
</ul></li>
<li>0.1.7 (2003-11-21)<ul>
<li>HTML output retains spaces (&nbsp; patch by Akira YAMADA). </li>
<li>Manued output is added. Use --manued command line option to get result in Manued-like format.</li>
<li>Fixed .chasenrc.docdiff to be compatible with the latest ChaSen, so that it does not cause error.</li>
<li>Alphabet words in the output may look ugly, since ChaSen does not keep spaces between alphabetical words recently.</li>
<li>Other minor bug fixes and code cleanup.</li>
</ul></li>
<li>0.2.0b2 (2001-08-31)<ul>
<li>Code cleanup.</li>
</ul></li>
<li>0.2.0b1 (2001-08-31)<ul>
<li>A bit faster than 0.1.x, using file cache.</li>
<li>A bit cleaner code.</li>
</ul></li>
<li>0.1.6 (2001-05-16)<ul>
<li>Increased diff option number from 100000 to 1000000 in order to support 900KB+ text files.</li>
</ul></li>
<li>0.1.5 (2001-01-17)<ul>
<li>Erased useless old code which were already commented out.</li>
<li>Added documentation. (Updated README, more comments)</li>
<li>First public release. Registered to RAA.</li>
</ul></li>
<li>0.1.4 (2001-01-16)<ul>
<li>Output is like <tag>ab</tag>, instead of ugly <tag>a</tag><tag>b</tag> (thanks again to Masatoshi Seki for suggestion).</li>
<li>Fixed hidden bug ('puts' was used to output result).</li>
<li>Some code clean-up, though still hairy enough.</li>
</ul></li>
<li>0.1.3 (2001-01-09)<ul>
<li>Tested with Ruby 1.6.2.</li>
<li>Fixed "meth(a,b,)" bug (thanks to Masatoshi Seki).</li>
<li>Switched development platform from Windows to Linux, but it should work fine on Windows too, except for ChaSen stuff.</li>
</ul></li>
<li>0.1.2 (2000-12-28)<ul>
<li>Mostly bug fix.</li>
</ul></li>
<li>0.1.1 (2000-12-25)<ul>
<li>Bug fix and some cleanup.</li>
<li>Quotes some of HTML special characters (<>&) when output in HTML.</li>
<li>Added support for tty output using escape sequence.</li>
</ul></li>
<li>0.1.0 (2000-12-19)<ul>
<li>ChaSen works fine now.</li>
<li>GetOptLong was introduced to support command line options.</li>
</ul></li>
<li>0.1.0a1 (2000-12-16)<ul>
<li>Added ChaSen support. Japanese word by word comparison requires ChaSen.</li>
<li>Converted scripts from Shift_JIS/CRLF to EUC-JP/LF.</li>
</ul></li>
<li>0.0.2 (2000-12-10)<ul>
<li>Rewritten to use class.</li>
</ul></li>
<li>0.0.1 (2000-12-09)<ul>
<li>First version. Proof-of-concept.</li>
<li>Supports ASCII, EUC-JP, LF only.</li>
<li>Supports HTML output only.</li>
<li>Requires GNU diff.</li>
<li>Distributed under the same license as Ruby's</li>
</ul></li>
</ul>
<p>See the ChangeLog for detail.</p>
<h2 id="todo">
<span lang="en">Todo</span>
<span lang="ja">予定</span>
</h2>
<ul>
<li>Incorporate ignore space patch.</li>
<li>Better auto-recognition of encodings and eols.</li>
<li>Make CSS and tty escape sequence customizable in config files.</li>
<li>Better multilingualization using Ruby 1.9 feature.</li>
<li>Write "DocPatch".</li>
</ul>
<hr />
<h2 id="description">
<span lang="en">Description</span>
<span lang="ja">簡単な説明</span>
</h2>
<p lang="en">
Compares two text files by word, by character, or by line
</p>
<p lang="ja">
2つのテキストファイルを単語ごと、文字ごと、あるいは行ごとに比較する
</p>
<h2 id="summary">
<span lang="en">Summary</span>
<span lang="ja">概要</span>
</h2>
<p lang="en">
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.
</p>
<p lang="ja">
DocDiffは2つのテキストファイルを比較してその違いを表示します。単語ごと、文字ごと、そして行ごとにファイルを比較できます。結果を出力する形式は、HTML, tty(文字端末向けのエスケープシーケンス), Manued(真鵺道という校正用のマークアップ形式)などが用意されており、ユーザ定義のタグを使うこともできます。
</p>
<p lang="en">
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, CR, LF, and CRLF.
</p>
<p lang="ja">
次のエンコーディング(文字コード)と行末コード(改行文字)をサポートしています: ASCII(およびISO-8859-*などのシングルバイトエンコーディング), UTF-8, EUC-JP, Shift_JIS、そしてCR, LF, CRLF.
</p>
<hr />
<h2 id="requirement">
<span lang="en">Requirement</span>
<span lang="ja">必要なもの</span>
</h2>
<ul>
<li lang="en"><a href="http://www.ruby-lang.org">Ruby</a><br />
(Note that you may need additional ruby library such as iconv, if your OS's Ruby package does not include those.)
</li>
<li lang="ja"><a href="http://www.ruby-lang.org">Ruby</a><br />
(注意: あなたが使っているOS向けのRubyパッケージがiconvなどのライブラリを含んでいない場合は、別途それらを手に入れる必要があるかもしれません。)
</li>
</ul>
<h2 id="installation">
<span lang="en">Installation</span>
<span lang="ja">インストール方法</span>
</h2>
<p lang="en">
Note that you need appropriate permission for proper installation (you may have to have a root/administrator privilege).
</p>
<p lang="ja">
注意: 正しくインストールするためには適切なファイルアクセス権限が必要です(管理者権限が必要な場合があります)。
</p>
<ol lang="en">
<li>
Place <samp>docdiff/</samp> directory and its contents to ruby library directory, so that ruby interpreter can load them.<br />
(e.g. <blockquote><p><samp># <kbd>cp -r docdiff /usr/lib/ruby/1.9.1</kbd></samp></p></blockquote>)
</li>
<li>
Place <samp>docdiff.rb</samp> in command binary directory.<br />
(e.g. <blockquote><p><samp># <kbd>cp docdiff.rb /usr/bin/</kbd></samp></p></blockquote>)<br />
(Optional) You may want to rename it to <samp>docdiff</samp>.<br />
(e.g. <blockquote><p><samp># <kbd>mv /usr/bin/docdiff.rb /usr/bin/docdiff</kbd></samp></p></blockquote>)<br />
(Optional) When invoked as <samp>chardiff</samp> or <samp>worddiff</samp>, docdiff runs with resolution set to <samp>char</samp> or <samp>word</samp>, respectively.<br />
(e.g. <blockquote><p><samp># <kbd>ln -s /usr/bin/docdiff.rb /usr/bin/chardiff.rb</kbd></samp><br />
<samp># <kbd>ln -s /usr/bin/docdiff.rb /usr/bin/worddiff.rb</kbd></samp></p></blockquote>)
</li>
<li>
Set appropriate permission.<br />
(e.g. <blockquote><p><samp># <kbd>chmod +x /usr/bin/docdiff.rb</kbd></samp></p></blockquote>)
</li>
<li>
(Optional) If you want site-wide configuration file, place <samp>docdiff.conf.example</samp> as <samp>/etc/docdiff/docdiff.conf</samp> and edit it.<br />
(e.g. <blockquote><p><samp># <kbd>cp docdiff.conf.example /etc/docdiff.conf</kbd><br />
# <kbd>$EDITOR /etc/docdiff.conf</kbd></samp></p></blockquote>)
</li>
<li>
(Optional) If you want per-user configuration file, place <samp>docdiff.conf.example</samp> as <samp>~/etc/docdiff/docdiff.conf</samp> and edit it.<br />
(e.g. <blockquote><p><samp>% <kbd>cp docdiff.conf.example ~/etc/docdiff.conf</kbd><br />
% <kbd>$EDITOR ~/etc/docdiff.conf</kbd></samp></p></blockquote>)
</li>
</ol>
<ol lang="ja">
<li>
<samp>docdiff/</samp>ディレクトリとその内容をrubyのライブラリを格納するディレクトリに配置して、Rubyインタプリタがdocdiffライブラリをロードできるようにする。<br />
(e.g. <blockquote><p><samp># <kbd>cp -r docdiff /usr/lib/ruby/1.9.1</kbd></samp></p></blockquote>)
</li>
<li>
<samp>docdiff.rb</samp>をコマンドを格納するディレクトリに配置する。<br />
(e.g. <blockquote><p><samp># <kbd>cp docdiff.rb /usr/bin/</kbd></samp></p></blockquote>)<br />
ここで必要に応じてファイル名を<samp>docdiff</samp>のように変更してもよい。<br />
(e.g. <blockquote><p><samp># <kbd>mv /usr/bin/docdiff.rb /usr/bin/docdiff</kbd></samp></p></blockquote>)
</li>
<li>
適切なパーミッションを設定する。<br />
(e.g. <blockquote><p><samp># <kbd>chmod +x /usr/bin/docdiff.rb</kbd></samp></p></blockquote>)
</li>
<li>
(オプション) もしサイトの全ユーザに適用される設定ファイルが必要なら、<samp>docdiff.conf.example</samp>を<samp>/etc/docdiff/docdiff.conf</samp>として配置し、編集する。<br />
(e.g. <blockquote><p><samp># <kbd>cp docdiff.conf.example /etc/docdiff.conf</kbd><br />
# <kbd>$EDITOR /etc/docdiff.conf</kbd></samp></p></blockquote>)
</li>
<li>
(オプション) もしユーザごとの設定ファイルが必要なら、<samp>docdiff.conf.example</samp>を<samp>~/etc/docdiff/docdiff.conf</samp>として配置し、編集する。<br />
(e.g. <blockquote><p><samp>% <kbd>cp docdiff.conf.example ~/etc/docdiff.conf</kbd><br />
% <kbd>$EDITOR ~/etc/docdiff.conf</kbd></samp></p></blockquote>)
</li>
</ol>
<hr />
<h2 id="usage">
<span lang="en">Usage</span>
<span lang="ja">使い方</span>
</h2>
<h3>
<span lang="en">Synopsis</span>
<span lang="ja">概要</span>
</h3>
<blockquote><p>
<kbd>docdiff [options] <var>oldfile</var> <var>newfile</var></kbd><br />
e.g. <samp>% <kbd>docdiff old.txt new.txt > diff.html</kbd></samp>
</p></blockquote>
<p lang="en">
See the help message for detail (<kbd>docdiff --help</kbd>).
</p>
<p lang="ja">
詳しくはヘルプメッセージを参照してください(<kbd>docdiff --help</kbd>)。
</p>
<h3>
<span lang="en">Example</span>
<span lang="ja">例</span>
</h3>
<blockquote>
<p lang="en"><samp>
% <kbd>cat sample/01.en.ascii.lf</kbd><br />
Hello, my name is Watanabe.<br />
I am just another Ruby porter.<br />
% <kbd>cat sample/02.en.ascii.lf</kbd><br />
Hello, my name is matz.<br />
It's me who has created Ruby. I am a Ruby hacker.<br />
% <kbd>docdiff sample/01.en.ascii.lf sample/02.en.ascii.lf</kbd><br />
<span class="common">Hello, my name is </span><span class="before-change"><del>Watanabe.</del></span><span class="after-change"><ins>matz.</ins></span><span class="common"><br /></span>
<span class="add"><ins>It's me who has created Ruby. </ins></span><span class="common">I am </span><span class="before-change"><del>just another </del></span><span class="after-change"><ins>a </ins></span><span class="common">Ruby </span><span class="before-change"><del>porter.</del></span><span class="after-change"><ins>hacker.</ins></span><span class="common"><br /></span>
%<br />
</samp></p>
<p lang="ja"><samp>
% <kbd>cat sample/01.ja.eucjp.lf</kbd><br />
こんにちは、私の名前はわたなべです。<br />
私はJust Another Ruby Porterです。<br />
% <kbd>cat sample/02.ja.eucjp.lf</kbd><br />
こんばんは、私の名前はまつもとです。<br />
Rubyを作ったのは私です。私はRuby Hackerです。<br />
% <kbd>docdiff sample/01.ja.eucjp.lf sample/02.ja.eucjp.lf</kbd><br />
<span class="before-change"><del>こんにちは</del></span><span class="after-change"><ins>こんばんは</ins></span><span class="common">、私の</span><span class="before-change"><del>名前はわたなべです</del></span><span class="after-change"><ins>名前はまつもとです</ins></span><span class="common">。<br /></span>
<span class="add"><ins>Rubyを作ったのは私です。</ins></span><span class="common">私は</span><span class="del"><del>Just Another </del></span><span class="common">Ruby </span><span class="before-change"><del>Porter</del></span><span class="after-change"><ins>Hacker</ins></span><span class="common">です。<br /></span>
%<br />
</samp></p>
</blockquote>
<h3>
<span lang="en">Configuration</span>
<span lang="ja">設定</span>
</h3>
<p lang="en">
You can place configuration files at:
</p>
<p lang="ja">
設定ファイルは次の場所に配置すると有効になります:
</p>
<ul lang="en">
<li><samp>/etc/docdiff/docdiff.conf</samp> (site-wide configuration)</li>
<li><samp>~/etc/docdiff/docdiff.conf</samp> (user configuration)<br />
(<samp>~/etc/docdiff/docdiff.conf</samp> is used by default in order to keep home directory clean, preventing dotfiles and dotdirs from scattering around. Alternatively, you can use <samp>~/.docdiff/docdiff.conf</samp> as user configuration file name, following the traditional Unix convention.)</li>
</ul>
<ul lang="ja">
<li><samp>/etc/docdiff/docdiff.conf</samp>(サイト全体の設定)</li>
<li><samp>~/etc/docdiff/docdiff.conf</samp>(ユーザごとの設定)<br />
(標準の設定では、ホームディレクトリにドットファイルをまき散らかさないために、<samp>~/etc/docdiff/docdiff.conf</samp>が使われます。または、昔ながらのUnixの慣習に従って<samp>~/.docdiff/docdiff.conf</samp>を使ってももちろん構いません。ただし両方同時には使えません)</li>
</ul>
<p lang="en">
Notation is as follows (also refer to the file <samp>docdiff.conf.example</samp> included in the distribution archive):
</p>
<p lang="ja">
設定ファイルの記法は次のとおりです(<samp>docdiff.conf.example</samp>ファイルも参照してください。配布アーカイブに含まれているはずです):
</p>
<blockquote>
<p><code>
# comment<br />
key1 = value<br />
key2 = value<br />
...
</code></p>
</blockquote>
<p lang="en">
Every value is treated as string, unless it seems like a number. In such case, value is treated as a number (usually an integer).
</p>
<p lang="ja">
値(value)は、数字として解釈できるもの以外は、すべて文字列として扱われます。数字は数値(たいていは整数)として扱われます。
</p>
<h2 id="tips">
<span lang="en">Troubleshooting and Tips</span>
<span lang="ja">問題解決とヒント</span>
</h2>
<h3>
<span lang="en">wrong argument type nil (expected Module) (TypeError)</span>
<span lang="ja">wrong argument type nil (expected Module) (TypeError)</span>
</h3>
<p lang="en">
Sometimes DocDiff fails to auto-recognize encoding and/or end-of-line
character. You may get an error like this.
</p>
<p lang="ja">
DocDiffがたまにエンコーディングや行末文字の自動判定に失敗して、次のようなエラーを出力することがあります。
</p>
<blockquote><p><samp>
charstring.rb:47:in `extend': wrong argument type nil (expected Module) (TypeError)<br />
</samp></p></blockquote>
<p lang="en">
In such a case, try explicitly specifying encoding and end-of-line character (e.g. <kbd>docdiff --utf8 --crlf</kbd>).
</p>
<p lang="ja">
このような場合は、エンコーディングや行末文字を明示的に指定してみてください(e.g. <kbd>docdiff --utf8 --crlf</kbd>)。
</p>
<h3>
<span lang="en">Inappropriate Insertion / Deletion</span>
<span lang="ja">不適切な挿入と削除</span>
</h3>
<p lang="en">
When comparing space-separated texts (such as English or program source code), the word next to the end of line is sometimes unnecessarily deleted and inserted. This is due to the limitation of DocDiff's word splitter. It splits strings into words like the following.
</p>
<p lang="ja">
スペースで区切られたテキスト(英文やプログラムのソースコードなど)を比較しているときに、行末にある単語が、特に必要もないのにいったん削除されてからまた挿入されることがあります。これはDocDiffの単語分割機能に制限があるせいで起きます。テキストは次のように単語に分割されます。
</p>
<p>text 1:</p>
<blockquote><p><samp>
foo bar<br />
("foo bar" => ["foo ", "bar"])
</samp></p></blockquote>
<p>text 2:</p>
<blockquote><p><samp>
foo<br />
bar<br />
("foo\nbar" => ["foo", "\n", "bar"])
</samp></p></blockquote>
<p>comparison result:</p>
<blockquote><p><samp>
<del>foo </del><ins>foo</ins><ins><br />
</ins>bar<br />
("<del>foo </del><ins>foo</ins><ins>\n</ins>bar")
</samp></p></blockquote>
<p lang="en">
Foo is (unnecessarily) deleted and inserted at the same time.
</p>
<p lang="ja">
Fooは(必要もないのに)削除されると同時に挿入されています。
</p>
<p lang="en">
I would like to fix this sometime, but it's not easy. If you split single space as single element (i.e. <samp>["foo", " ", "bar"]</samp>), the word order of the comparison result will be less natural. Suggestions are welcome.
</p>
<p lang="ja">
作者はこの問題をいつか解決したいと思っていますが、簡単ではなさそうです。もし空白を1つの要素として分割したなら(i.e. <samp>["foo", " ", "bar"]</samp>)、比較した結果出力される単語の並びが今よりも不自然になってしまいます。良い案があったら教えてください。
</p>
<h3>
<span lang="en">Using DocDiff with Version Control Systems</span>
<span lang="ja">DocDiffをバージョン管理システムと組み合わせて使う</span>
</h3>
<p lang="en">
If you want to use DocDiff as an external diff program from VCSs, the following may work.
</p>
<p lang="ja">
DocDiffをVCSの外部diffプログラムとして使いたければ、次のようにするとよいでしょう。
</p>
<dl>
<dt>Subversion</dt>
<dd>
<p>
<samp>% <kbd>svn diff --diff-cmd=docdiff --extensions "--ascii --lf --tty --digest"</kbd></samp>
</p>
</dd>
<dt>Git</dt>
<dd>
<p>
<samp>% <kbd>GIT_EXTERNAL_DIFF=~/bin/gitdocdiff.sh git diff</kbd></samp>
</p>
<p>
~/bin/gitdocdiff.sh:
</p>
<pre>#!/bin/sh
docdiff --ascii --lf --tty --digest $2 $5</pre>
</dd>
</dl>
<p lang="en">
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.
</p>
<p lang="ja">
zshを使えば、いろいろな場所にある文書をDocDiffや他のユーティリティで自由に比較できます。次の例ではリポジトリ内の特定のリビジョンのfoo.htmlとウェブサイト上のfoo.htmlとを比較しています。
</p>
<blockquote><p>CVS:<br />
<samp>% <kbd>docdiff =(cvs -Q update -p -r 1.3 foo.html) =(curl --silent http://www.example.org/foo.html)</kbd></samp>
</p></blockquote>
<blockquote><p>Subversion:<br />
<samp>% <kbd>docdiff =(svn cat -r3 http://svn.example.org/repos/foo.html) =(curl --silent http://www.example.org/foo.html)</kbd></samp>
</p></blockquote>
<h3>
<span lang="en">Comparing Non-plain Text Files Such As HTML or Microsoft Word Documents</span>
<span lang="ja">HTMLやWord文書などのプレーンテキストではないファイルを比較する</span>
</h3>
<p lang="en">
You can compare files other than plain text, such as HTML and Microsoft Word documents, if you use appropriate converter.
</p>
<p lang="ja">
適切な変換ツールを使えば、HTMLやMicrosoft Word文書など、プレーンテキスト以外のファイルも比較できます。
</p>
<blockquote><p>
<span lang="en">Comparing the content of two HTML documents (without tags)</span>
<span lang="ja">HTML文書の内容(タグを除く)を比較</span>:<br />
<samp>% <kbd>docdiff =(w3m -dump -cols 10000 foo.html) =(w3m -dump -cols 10000 http://www.example.org/foo.html)</kbd></samp>
</p></blockquote>
<blockquote><p>
<span lang="en">Comparing the content of two Microsoft Word documents</span>
<span lang="ja">Microsoft Word文書の内容を比較</span>:<br />
<samp>% <kbd>docdiff =(wvWare foo.doc | w3m -T text/html -dump -cols 10000) =(wvWare bar.doc | w3m -T text/html -dump -cols 10000)</kbd></samp>
</p></blockquote>
<h3>
<span lang="en">Workaround for Latin-* (ISO-8859-*) encodings: Use ASCII</span>
<span lang="ja">Latin-* (ISO-8859-*) のための回避策: ASCIIを指定する</span>
</h3>
<p lang="en">
If you want to compare Latin-* (ISO-8859-*) texts, try using ASCII as their encoding. When ASCII is specified, DocDiff assumes single-byte characters.
</p>
<p lang="ja">
文字コードがLatin-* (ISO-8859-*) のテキストを扱うときは、文字コードにASCIIを指定してみてください。ASCIIが指定されると、DocDiffは対象をシングルバイト文字のテキストとして扱います。
</p>
<blockquote><p>Comparing Latin-1 texts:<br />
<samp>% <kbd>docdiff --encoding=ASCII latin-1-old.txt latin-1-new.txt</kbd></samp>
</p></blockquote>
<hr />
<h2 id="license">
<span lang="en">License</span>
<span lang="ja">ライセンス</span>
</h2>
<p lang="en">
This software is distributed under so-called modified BSD style license (<a href="http://www.opensource.org/licenses/bsd-license.php">http://www.opensource.org/licenses/bsd-license.php</a> (without advertisement clause)). By contributing to this software, you agree that your contribution may be incorporated under the same license.
</p>
<p lang="ja">
このソフトウェアはいわゆる修正BSDスタイルライセンス(<a href="http://www.opensource.org/licenses/bsd-license.php">http://www.opensource.org/licenses/bsd-license.php</a>(広告条項なし))のもとで配布されています。このソフトウェアに貢献すると、あなたは貢献したものが同ライセンスのもとに取り込まれることに同意したとみなされます。
</p>
<p lang="en">
Copyright and condition of use of main portion of the source:
</p>
<p lang="ja">
ソースコードの主となる部分の著作権と使用条件は次のとおりです:
</p>
<blockquote>
<pre>
Copyright (C) Hisashi MORITA. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
</pre>
</blockquote>
<p lang="en">
diff library (<samp>docdiff/diff.rb</samp> and <samp>docdiff/diff/*</samp>) was originally a part of Ruby/CVS by Akira TANAKA. Ruby/CVS is licensed under modified BSD style license. See the following for detail.
</p>
<p lang="ja">
diffライブラリ(<samp>docdiff/diff.rb</samp>および<samp>docdiff/diff/*</samp>)は、もともと田中哲さんによるRuby/CVSの一部分でした。Ruby/CVSは修正BSDスタイルライセンスのもとで配布されています。詳細は次を参照してください。
</p>
<ul>
<li><a href="http://raa.ruby-lang.org/list.rhtml?name=ruby-cvs">
http://raa.ruby-lang.org/list.rhtml?name=ruby-cvs</a></li>
<li><a href="http://cvs.m17n.org/~akr/ruby-cvs/">
http://cvs.m17n.org/~akr/ruby-cvs/</a></li>
</ul>
<h2 id="credits">
<span lang="en">Credits</span>
<span lang="ja">クレジット</span>
</h2>
<ul>
<li>Hisashi MORITA (primary author)</li>
</ul>
<h2 id="acknowledgments">
<span lang="en">Acknowledgments</span>
<span lang="ja">謝辞</span>
</h2>
<ul>
<li>Akira TANAKA (diff library author)</li>
<li>Shin'ichiro HARA (initial idea and algorithm suggestion)</li>
<li>Masatoshi SEKI (patch)</li>
<li>Akira YAMADA (patch, Debian package)</li>
<li>Kenshi MUTO (testing, bug report, Debian package)</li>
<li>Kazuhiro NISHIYAMA (bug report)</li>
<li>Hiroshi OHKUBO (bug report)</li>
<li>Shugo MAEDA (bug report)</li>
<li>Kazuhiko (patch)</li>
</ul>
<hr />
<h2 id="resources">
<span lang="en">Resources</span>
<span lang="ja">情報源</span>
</h2>
<h3>
<span lang="en">Format</span>
<span lang="ja">フォーマット</span>
</h3>
<ul>
<li>HTML/XHTML<br />
<a href="http://www.w3.org">http://www.w3.org</a></li>
<li>tty (Graphic rendition using VT100 / ANSI escape sequence)<br />
VT100: <a href="http://vt100.net/docs/tp83/appendixb.html">
http://vt100.net/docs/tp83/appendixb.html</a><br />
ANSI: <a href="http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html">
http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html</a></li>
<li>Manued (Manuscript Editing language: a proofreading method for text)<br />
<a href="http://www.archi.is.tohoku.ac.jp/~yamauchi/otherprojects/manued/index.shtml">
http://www.archi.is.tohoku.ac.jp/~yamauchi/otherprojects/manued/index.shtml</a></li>
</ul>
<h3>
<span lang="en">Similar Software</span>
<span lang="ja">同様の目的を持ったソフトウェア</span>
</h3>
<p lang="en">
There are several other software that can compare text word by word and/or character by character.
</p>
<p lang="ja">
テキストを単語単位や文字単位で比較することができるソフトウェアは、ほかにもあります。
</p>
<ul>
<li>GNU wdiff (Seems to support single byte characters only.)<br />
<a href="http://www.gnu.org/directory/GNU/wdiff.html">
http://www.gnu.org/directory/GNU/wdiff.html</a></li>
<li>cdif by Kazumasa UTASHIRO (Supports several Japanese encodings.)<br />
<a href="http://srekcah.org/~utashiro/perl/scripts/cdif">
http://srekcah.org/~utashiro/perl/scripts/cdif</a></li>
<li>ediff for Emacsen<br />
<a href="http://www.xemacs.org/Documentation/packages/html/ediff.html">
http://www.xemacs.org/Documentation/packages/html/ediff.html</a></li>
<li>diff-detail for xyzzy, by Hiroshi OHKUBO<br />
<a href="http://ohkubo.s53.xrea.com/xyzzy/index.html#diff-detail">
http://ohkubo.s53.xrea.com/xyzzy/index.html#diff-detail</a></li>
<li>Manuediff (Outputs difference in Manued format.)<br />
<a href="http://hibiki.miyagi-ct.ac.jp/~suzuki/comp/export/manuediff.html">
http://hibiki.miyagi-ct.ac.jp/~suzuki/comp/export/manuediff.html</a></li>
<li>YASDiff (Yet Another Scheme powered diff) by Y. Fujisawa<br />
<a href="http://nnri.dip.jp/~yf/cgi-bin/yaswiki2.cgi?name=YASDiff&parentid=0">
http://nnri.dip.jp/~yf/cgi-bin/yaswiki2.cgi?name=YASDiff&parentid=0</a></li>
<li>WinMerge (GUI diff tool for Windows)<br />
<a href="http://winmerge.org/">http://winmerge.org/</a></li>
</ul>
<hr />
</body>
</html>
|