Thomas Wittek > Konstrukt-0.5-beta13 > Konstrukt::Plugin::diff

Download:
konstrukt/Konstrukt-0.5-beta13.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View Bugs
Report a bug
Source  

NAME ^

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

SYNOPSIS ^

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.

DESCRIPTION ^

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");

CONFIGURATION ^

You may configure the default behaviour of the diff plugin:

        #context: number of (equal) lines around a diff hunk
        diff/context 1048576

METHODS ^

init

Initialization.

prepare

We can do the work already in the prepare run if there is only static content inside the tag.

Parameters:

execute

Now finally generate the result, if not already done in the prepare run.

Parameters:

process

The real work is done here.

Parameters:

diff

Generates the XHTML-Tables.

Parameters

file_header

Generates the header of the whole diff.

Will be called by Text::Diff.

hunk_header

Generates the header of each hunk.

Will be called by Text::Diff.

hunk

Generates the table rows for each hunk.

Will be called by Text::Diff.

hunk_footer

Generates the footer of each hunk.

Will be called by Text::Diff.

file_footer

Generates the footer of the whole diff.

Will be called by Text::Diff.

AUTHOR ^

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.

SEE ALSO ^

Konstrukt::Plugin, Konstrukt