I have an update to CGI::Wiki::Kwiki to integrate it with my diffing module
CGI::Wiki::Plugin::Diff.
I attach a tar kit with the full change, including a new template file and
updates to CHANGES, MANIFEST, Build.PL etc.
I do not have the facilities to run this up as a full wiki site :(.
Please can some of you have a go at break^Wtesting it.
Just in case mailmangler mangles the tarball, I am including the main body
of the change, as a patch to Kwiki.pm:
--- CGI-Wiki-Kwiki-0.44/lib/CGI/Wiki/Kwiki.pm Mon Nov 24 20:05:37 2003
+++ CGI-Wiki-Kwiki-0.45/lib/CGI/Wiki/Kwiki.pm Sun Dec 7 12:32:20 2003
@@ -152,9 +152,10 @@
use CGI::Wiki;
use Search::InvertedIndex;
use CGI::Wiki::Search::SII;
+use CGI::Wiki::Plugin::Diff;
use Template;
-our $VERSION = '0.44';
+our $VERSION = '0.45';
my $default_options = {
db_type => 'MySQL',
@@ -177,6 +178,8 @@
search_map => "./search_map",
};
+our $diff_plugin = CGI::Wiki::Plugin::Diff->new;
+
sub new {
my $class = shift;
my $self = bless {}, $class;
@@ -246,6 +249,8 @@
search => $self->{search},
) or die "Can't create CGI::Wiki object";
+ $self->{wiki}->register_plugin( plugin => $diff_plugin );
+
return $self;
}
@@ -313,8 +318,14 @@
} else {
- if ($args{diffversion}) {
- die "diff not implemented yet\n";
+ if ($args{diffversion}) {
+ my %diff = $diff_plugin->differences(
+ node => $node,
+ left_version => $args{version},
+ right_version => $args{diffversion} );
+
+ $self->process_template('differences.tt', $node, \%diff);
+
} else {
$self->display_node($node, $args{version});
}
======End of patch========================