NAME

OpenGuides::Diff - An OpenGuides helper to extract differences between two versions of a node.

DESCRIPTION

Makes a nice extract of differences between two versions of an OpenGuides node. Distributed and installed as part of the OpenGuides project, not intended for independent installation. This documentation is probably only useful to OpenGuides developers.

SYNOPSIS

use Config::Tiny;
use OpenGuides::Diff;
use OpenGuides::Template;
use OpenGuides::Utils;

my $config = Config::Tiny->read( "wiki.conf" );
my $wiki = OpenGuides::Utils->make_wiki_object( config => $config );

# Show the differences between versions 3 and 5 of the home node.
my %diff_vars = OpenGuides::Diff->formatted_diff_vars(
    wiki => $wiki,
    node => "Home Page",
    versions => [5, 3]
);
print OpenGuides::Template->output( wiki     => $wiki,
                                    config   => $config,
                                    node     => "Home Page",
                                    template => "differences.tt",
                                    vars     => \%diff_vars );

METHODS

formatted_diff_vars
my %diff_vars = OpenGuides::Diff->formatted_diff_vars(
    wiki     => $wiki,
    node     => "Home Page",
    versions => [5, 3]
);

Returns a hash with the key-value pairs:

  • ver1 - The node version whose content we're considering canonical.

    ver2 - The node version that we're showing the differences from.

    content - The (formatted) contents of version ver1 of the node.

    diff - An array of hashrefs of hunks of differences between the versions - access from your template as diff.hunk.left and diff.hunk.right.

That explanation sucks. Better wording solicited.

SEE ALSO

OpenGuides

AUTHOR

The OpenGuides Project (openguides-dev@openguides.org)

COPYRIGHT

Copyright (C) 2003 The OpenGuides Project.  All Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

CREDITS

Code in this module mostly written by Ivor Williams, <ivor.williams@tiscali.co.uk>

1 POD Error

The following errors were encountered while parsing the POD:

Around line 187:

You forgot a '=back' before '=head1'