
Konstrukt::Plugin::diff - Print out an XHTML table with the difference between two texts

Usage:
<& diff &>
<$ left $>
1
2
3
<$ / $>
<$ right $>
1
3
<$ / $>
<& / &>
or
<!-- set another amount of "context" lines -->
<& diff context="2" &>
...
<& / &>
or
<!-- define a header for the columns -->
<& diff left_header="text a" right_header="text b" &>
...
<& / &>
Result:
A table showing the difference between the two texts.

With this plugin you compare two texts and put out the difference as an XHTML table.
You may also use its Perl interface:
my $diff = use_plugin 'diff';
my $html = $diff->diff("1\n2\n3", "1\n3");

You may configure the default behaviour of the diff plugin:
#context: number of (equal) lines around a diff hunk
diff/context 1048576

Initialization.
We can do the work already in the prepare run if there is only static content inside the tag.
Parameters:
Now finally generate the result, if not already done in the prepare run.
Parameters:
The real work is done here.
Parameters:
Generates the XHTML-Tables.
Parameters
Generates the header of the whole diff.
Will be called by Text::Diff.
Generates the header of each hunk.
Will be called by Text::Diff.
Generates the table rows for each hunk.
Will be called by Text::Diff.
Generates the footer of each hunk.
Will be called by Text::Diff.
Generates the footer of the whole diff.
Will be called by Text::Diff.

Copyright 2006 Thomas Wittek (mail at gedankenkonstrukt dot de). All rights reserved.
This document is free software. It is distributed under the same terms as Perl itself.
