svn: /pear/peardoc/trunk/en/package/ text/text-diff/examples/1.htm text/text-diff/examples/2.htm text/text-diff/examples/rend-context.php text/text-diff/examples/rend-context.txt text/text-diff/examples/rend-inline.php text/text-diff/examples/rend-inline.txt text/text-diff/examples/rend-unified.php text/text-diff/examples/rend-unified.txt text/text-diff/intro.xml text/text-diff.xml text-entities.xml

[email protected] (Christian Weiske)
Newsgroups php.pear.doc
Message-ID <[email protected]>
cweiske                                  Thu, 03 Sep 2009 20:33:13 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=288006

Log:
first version of text_diff intro

Changed paths:
    A   pear/peardoc/trunk/en/package/text/text-diff/
    A   pear/peardoc/trunk/en/package/text/text-diff/examples/
    A   pear/peardoc/trunk/en/package/text/text-diff/examples/1.htm
    A   pear/peardoc/trunk/en/package/text/text-diff/examples/2.htm
    A   pear/peardoc/trunk/en/package/text/text-diff/examples/rend-context.php
    A   pear/peardoc/trunk/en/package/text/text-diff/examples/rend-context.txt
    A   pear/peardoc/trunk/en/package/text/text-diff/examples/rend-inline.php
    A   pear/peardoc/trunk/en/package/text/text-diff/examples/rend-inline.txt
    A   pear/peardoc/trunk/en/package/text/text-diff/examples/rend-unified.php
    A   pear/peardoc/trunk/en/package/text/text-diff/examples/rend-unified.txt
    A   pear/peardoc/trunk/en/package/text/text-diff/intro.xml
    A   pear/peardoc/trunk/en/package/text/text-diff.xml
    U   pear/peardoc/trunk/en/package/text-entities.xml
svn-diffs-288006.txt (text/x-diff, 11.4 KB)
Added: pear/peardoc/trunk/en/package/text/text-diff/examples/1.htm
===================================================================
--- pear/peardoc/trunk/en/package/text/text-diff/examples/1.htm	                        (rev 0)
+++ pear/peardoc/trunk/en/package/text/text-diff/examples/1.htm	2009-09-03 20:33:13 UTC (rev 288006)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html>
+ <head>
+  <title>PEAR Bug Tracking</title>
+ </head>
+ <body>
+  <h1>PEAR Bug Tracking System</h1>
+  <div class="bug-box">
+   <h2>Report new Bug</h2>
+   <p>Got a test case?</p>
+
+   <p>Reproducable steps?</p>
+  </div>
+ </body>
+</html>

Added: pear/peardoc/trunk/en/package/text/text-diff/examples/2.htm
===================================================================
--- pear/peardoc/trunk/en/package/text/text-diff/examples/2.htm	                        (rev 0)
+++ pear/peardoc/trunk/en/package/text/text-diff/examples/2.htm	2009-09-03 20:33:13 UTC (rev 288006)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html>
+ <head>
+  <title>PEAR Bug Tracker</title>
+ </head>
+ <body>
+  <h1>PEAR Bug Tracking System</h1>
+  <div class="bug-box bug-box-first">
+   <h2>Report New Bug</h2>
+   <p>
+    Got a test case or reproducible steps?
+   </p>
+  </div>
+ </body>
+</html>

Added: pear/peardoc/trunk/en/package/text/text-diff/examples/rend-context.php
===================================================================
--- pear/peardoc/trunk/en/package/text/text-diff/examples/rend-context.php	                        (rev 0)
+++ pear/peardoc/trunk/en/package/text/text-diff/examples/rend-context.php	2009-09-03 20:33:13 UTC (rev 288006)
@@ -0,0 +1,11 @@
+<?php
+require_once 'Text/Diff.php';
+require_once 'Text/Diff/Renderer/context.php';
+
+$lines1 = file('1.htm');
+$lines2 = file('2.htm');
+
+$diff     = new Text_Diff('auto', array($lines1, $lines2));
+$renderer = new Text_Diff_Renderer_context();
+echo $renderer->render($diff);
+?>
\ No newline at end of file

Added: pear/peardoc/trunk/en/package/text/text-diff/examples/rend-context.txt
===================================================================
--- pear/peardoc/trunk/en/package/text/text-diff/examples/rend-context.txt	                        (rev 0)
+++ pear/peardoc/trunk/en/package/text/text-diff/examples/rend-context.txt	2009-09-03 20:33:13 UTC (rev 288006)
@@ -0,0 +1,29 @@
+***************
+*** 3,13 ****
+   <head>
+!   <title>PEAR Bug Tracking</title>
+   </head>
+   <body>
+    <h1>PEAR Bug Tracking System</h1>
+!   <div class="bug-box">
+!    <h2>Report new Bug</h2>
+!    <p>Got a test case?</p>
+!
+!    <p>Reproducable steps?</p>
+    </div>
+   </body>
+  </html>
+--- 3,13 ----
+   <head>
+!   <title>PEAR Bug Tracker</title>
+   </head>
+   <body>
+    <h1>PEAR Bug Tracking System</h1>
+!   <div class="bug-box bug-box-first">
+!    <h2>Report New Bug</h2>
+!    <p>
+!     Got a test case or reproducible steps?
+!    </p>
+    </div>
+   </body>
+  </html>

Added: pear/peardoc/trunk/en/package/text/text-diff/examples/rend-inline.php
===================================================================
--- pear/peardoc/trunk/en/package/text/text-diff/examples/rend-inline.php	                        (rev 0)
+++ pear/peardoc/trunk/en/package/text/text-diff/examples/rend-inline.php	2009-09-03 20:33:13 UTC (rev 288006)
@@ -0,0 +1,11 @@
+<?php
+require_once 'Text/Diff.php';
+require_once 'Text/Diff/Renderer/inline.php';
+
+$lines1 = file('1.htm');
+$lines2 = file('2.htm');
+
+$diff     = new Text_Diff('auto', array($lines1, $lines2));
+$renderer = new Text_Diff_Renderer_inline();
+echo $renderer->render($diff);
+?>
\ No newline at end of file

Added: pear/peardoc/trunk/en/package/text/text-diff/examples/rend-inline.txt
===================================================================
--- pear/peardoc/trunk/en/package/text/text-diff/examples/rend-inline.txt	                        (rev 0)
+++ pear/peardoc/trunk/en/package/text/text-diff/examples/rend-inline.txt	2009-09-03 20:33:13 UTC (rev 288006)
@@ -0,0 +1,18 @@
+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+&lt;html&gt;
+ &lt;head&gt;
+  &lt;title&gt;PEAR Bug <del>Tracking&lt;/title&gt;</del><ins>Tracker&lt;/title&gt;</ins>
+ &lt;/head&gt;
+ &lt;body&gt;
+  &lt;h1&gt;PEAR Bug Tracking System&lt;/h1&gt;
+  &lt;div <del>class=&quot;bug-box&quot;&gt;</del><ins>class=&quot;bug-box bug-box-first&quot;&gt;</ins>
+   &lt;h2&gt;Report <del>new</del><ins>New</ins> Bug&lt;/h2&gt;<del>
+   &lt;p&gt;Got</del><ins>
+   &lt;p&gt;
+    Got</ins> a test <del>case?&lt;/p&gt;
+
+   &lt;p&gt;Reproducable steps?&lt;/p&gt;</del><ins>case or reproducible steps?
+   &lt;/p&gt;</ins>
+  &lt;/div&gt;
+ &lt;/body&gt;
+&lt;/html&gt;

Added: pear/peardoc/trunk/en/package/text/text-diff/examples/rend-unified.php
===================================================================
--- pear/peardoc/trunk/en/package/text/text-diff/examples/rend-unified.php	                        (rev 0)
+++ pear/peardoc/trunk/en/package/text/text-diff/examples/rend-unified.php	2009-09-03 20:33:13 UTC (rev 288006)
@@ -0,0 +1,11 @@
+<?php
+require_once 'Text/Diff.php';
+require_once 'Text/Diff/Renderer/unified.php';
+
+$lines1 = file('1.htm');
+$lines2 = file('2.htm');
+
+$diff     = new Text_Diff('auto', array($lines1, $lines2));
+$renderer = new Text_Diff_Renderer_unified();
+echo $renderer->render($diff);
+?>
\ No newline at end of file

Added: pear/peardoc/trunk/en/package/text/text-diff/examples/rend-unified.txt
===================================================================
--- pear/peardoc/trunk/en/package/text/text-diff/examples/rend-unified.txt	                        (rev 0)
+++ pear/peardoc/trunk/en/package/text/text-diff/examples/rend-unified.txt	2009-09-03 20:33:13 UTC (rev 288006)
@@ -0,0 +1,20 @@
+@@ -3,13 +3,13 @@
+  <head>
+-  <title>PEAR Bug Tracking</title>
++  <title>PEAR Bug Tracker</title>
+  </head>
+  <body>
+   <h1>PEAR Bug Tracking System</h1>
+-  <div class="bug-box">
+-   <h2>Report new Bug</h2>
+-   <p>Got a test case?</p>
+-
+-   <p>Reproducable steps?</p>
++  <div class="bug-box bug-box-first">
++   <h2>Report New Bug</h2>
++   <p>
++    Got a test case or reproducible steps?
++   </p>
+   </div>
+  </body>
+ </html>

Added: pear/peardoc/trunk/en/package/text/text-diff/intro.xml
===================================================================
--- pear/peardoc/trunk/en/package/text/text-diff/intro.xml	                        (rev 0)
+++ pear/peardoc/trunk/en/package/text/text-diff/intro.xml	2009-09-03 20:33:13 UTC (rev 288006)
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="utf-8"?>
+<chapter xmlns="http://docbook.org/ns/docbook" version="lillet"
+ xml:id="package.text.text-diff.intro"
+>
+ <info>
+  <title>Introduction to Text_Diff</title>
+ </info>
+
+ <para>
+  <classname>Text_Diff</classname> helps you generating
+  difference views between two or three text files.
+ </para>
+
+ <programlisting role="text"><![CDATA[
+@@ -1,3 +1,3 @@
+ This line is the same.
+-This line is different in 1.txt
++This line is different in 2.txt
+ This line is the same.
+]]></programlisting>
+
+ <para>
+  Diffs are created in two steps:
+ </para>
+ <orderedlist>
+  <listitem>
+   <simpara>Computing the difference of the files</simpara>
+  </listitem>
+  <listitem>
+   <simpara>Creating the output of the difference</simpara>
+  </listitem>
+ </orderedlist>
+
+ <para>
+  In Text_Diff, an <emphasis>Engine</emphasis> is used to compute the difference
+  between the files/strings. The packages contains several of them:
+  <literal>native</literal>, <literal>shell</literal>, <literal>string</literal>
+  and <literal>xdiff</literal>. One should use <literal>auto</literal> to let
+  Text_Diff decide which one is the best for the system.
+ </para>
+
+ <para>
+  The second part, creating the output, is made possible by
+  renderers. Text_Diff comes with <literal>context</literal>,
+  <literal>inline</literal> and <literal>unified</literal>
+  renderers.
+ </para>
+
+ <section xml:id="package.text.text-diff.intro.renderers">
+  <info>
+   <title>Renderer examples</title>
+  </info>
+
+  <example xml:id="package.text.text-diff.intro.renderers.context">
+   <title>Context renderer</title>
+
+   <programlisting role="php">
+    <xi:include parse="text"
+     xmlns:xi="http://www.w3.org/2001/XInclude"
+     href="&package.text.text-diff.examples.rend-context.php;"
+    >
+     <xi:fallback>FIXME:MISSING XINCLUDE CONTENT</xi:fallback>
+    </xi:include>
+   </programlisting>
+
+   <simpara>
+    generates the following output:
+   </simpara>
+
+   <programlisting role="diff">
+    <xi:include parse="text"
+     xmlns:xi="http://www.w3.org/2001/XInclude"
+     href="&package.text.text-diff.examples.rend-context.txt;"
+    >
+     <xi:fallback>FIXME:MISSING XINCLUDE CONTENT</xi:fallback>
+    </xi:include>
+   </programlisting>
+  </example>
+
+
+  <example xml:id="package.text.text-diff.intro.renderers.inline">
+   <title>Inline renderer</title>
+
+   <programlisting role="php">
+    <xi:include parse="text"
+     xmlns:xi="http://www.w3.org/2001/XInclude"
+     href="&package.text.text-diff.examples.rend-inline.php;"
+    >
+     <xi:fallback>FIXME:MISSING XINCLUDE CONTENT</xi:fallback>
+    </xi:include>
+   </programlisting>
+
+   <simpara>
+    generates the following output:
+   </simpara>
+
+   <programlisting role="diff">
+    <xi:include parse="text"
+     xmlns:xi="http://www.w3.org/2001/XInclude"
+     href="&package.text.text-diff.examples.rend-inline.txt;"
+    >
+     <xi:fallback>FIXME:MISSING XINCLUDE CONTENT</xi:fallback>
+    </xi:include>
+   </programlisting>
+  </example>
+
+
+  <example xml:id="package.text.text-diff.intro.renderers.unified">
+   <title>Unified renderer</title>
+
+   <programlisting role="php">
+    <xi:include parse="text"
+     xmlns:xi="http://www.w3.org/2001/XInclude"
+     href="&package.text.text-diff.examples.rend-unified.php;"
+    >
+     <xi:fallback>FIXME:MISSING XINCLUDE CONTENT</xi:fallback>
+    </xi:include>
+   </programlisting>
+
+   <simpara>
+    generates the following output:
+   </simpara>
+
+   <programlisting role="diff">
+    <xi:include parse="text"
+     xmlns:xi="http://www.w3.org/2001/XInclude"
+     href="&package.text.text-diff.examples.rend-unified.txt;"
+    >
+     <xi:fallback>FIXME:MISSING XINCLUDE CONTENT</xi:fallback>
+    </xi:include>
+   </programlisting>
+  </example>
+
+ </section>
+
+</chapter>

Added: pear/peardoc/trunk/en/package/text/text-diff.xml
===================================================================
--- pear/peardoc/trunk/en/package/text/text-diff.xml	                        (rev 0)
+++ pear/peardoc/trunk/en/package/text/text-diff.xml	2009-09-03 20:33:13 UTC (rev 288006)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<book xmlns="http://docbook.org/ns/docbook" version="lillet"
+ xml:id="package.text.text-diff"
+>
+ <info>
+  <title>Text_Diff</title>
+  <abstract>
+   <para>
+    Generate and display difference analysis between text based files.
+   </para>
+  </abstract>
+ </info>
+
+ &package.text.text-diff.intro;
+</book>

Modified: pear/peardoc/trunk/en/package/text-entities.xml
===================================================================
--- pear/peardoc/trunk/en/package/text-entities.xml	2009-09-03 20:16:37 UTC (rev 288005)
+++ pear/peardoc/trunk/en/package/text-entities.xml	2009-09-03 20:33:13 UTC (rev 288006)
@@ -1,5 +1,6 @@
 &package.text.text-captcha;
 &package.text.text-captcha-numeral;
+&package.text.text-diff;
 &package.text.text-figlet;
 &package.text.text-highlighter;
 &package.text.text-languagedetect;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.