OpenGuides::Diff - An OpenGuides helper to extract differences between two versions of a node.
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.
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 );
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.
ver1
diff - An array of hashrefs of hunks of differences between the versions - access from your template as diff.hunk.left and diff.hunk.right.
hunks
diff.hunk.left
diff.hunk.right
That explanation sucks. Better wording solicited.
OpenGuides
The OpenGuides Project (openguides-dev@openguides.org)
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.
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:
You forgot a '=back' before '=head1'
To install OpenGuides, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OpenGuides
CPAN shell
perl -MCPAN -e shell install OpenGuides
For more information on module installation, please visit the detailed CPAN module installation guide.