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========================
On Sun 07 Dec 2003, Ivor Williams ivor.williams@tiscali.co.uk wrote:
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.
Nice work, thanks Ivor. I just installed it here at work and it seems mostly fine; just a couple of bugs that I shall try to iron out. I have applied the changes to CVS.
I do not have the facilities to run this up as a full wiki site :(.
What facilities are you missing? Is this because you're on Windows? It would be great to have the software tested out on non-unix.
Kake
On Wed 10 Dec 2003, Kate L Pugh kake@earth.li wrote:
Nice work, thanks Ivor. I just installed it here at work and it seems mostly fine; just a couple of bugs that I shall try to iron out. I have applied the changes to CVS.
Bugs fixed, changes in CVS, 0.46 released.
Kake
----- Original Message ----- From: "Kate L Pugh" kake@earth.li To: cgi-wiki-dev@earth.li Sent: 10 December 2003 16:29 Subject: Re: [cgi-wiki-dev] CGI-Wiki-Kwiki-0.45 with added diffs, please test
On Wed 10 Dec 2003, Kate L Pugh kake@earth.li wrote:
Nice work, thanks Ivor. I just installed it here at work and it seems mostly fine; just a couple of bugs that I shall try to iron out. I have applied the changes to CVS.
Bugs fixed, changes in CVS, 0.46 released.
I noticed a couple of points after I submitted the patch. There is an error in the template, differences.tt - it should be referring to variables [% left_version %] and [% right_version %] not [% ver1 %] and [% ver2 %].
Also, there are stylesheet entries needed to see the diff in full glorious technicolour:
.diff1{ background-color:pink; }
.diff2{ background-color:yellow; }
Perhaps the default style in header.tt should include these, and the documentation should mention that these should be included in the stylesheet.
I'm also looking at and writing more tests for CGI::Wiki::Plugin::Diff. If you find any bugs/quirks/anomalies in the diffing done by this module, please let me know, on this list, off-list or on RT. I've already found one with incorrect tokenising of <br /> and <BR />, which can be cured by making the regex case insensitive.
Also thanks to Jody for applying the patch to http://collab.orative.org.uk/kwiki, which I have been using to see the results.
Ivor.
On Thu 11 Dec 2003, Ivor Williams ivor.williams@tiscali.co.uk wrote:
I noticed a couple of points after I submitted the patch. There is an error in the template, differences.tt - it should be referring to variables [% left_version %] and [% right_version %] not [% ver1 %] and [% ver2 %].
I fixed that by setting ver1 and ver2 before calling the template.
Also, there are stylesheet entries needed to see the diff in full glorious technicolour:
Perhaps the default style in header.tt should include these, and the documentation should mention that these should be included in the stylesheet.
Yes, that might be good. Earle, you're the CSS expert - is it evil to put style directives in the HTML itself, or is it OK because an external stylesheet will always override them?
I'm also looking at and writing more tests for CGI::Wiki::Plugin::Diff.
Cool. Can we get OpenGuides::Diff using this plugin too?
Kake
Two Quick questions: 1 Does wiki-toolkit.org show all the functionality of the toolkit? I'm not quite clear on the line between this and the open guides stuff. 2 Was the name Wiki::Toolkit ratified by the CPAN people? Cheers, Martin -- Martin@Cleaver.org - +1 416 832 7759 Melbourne Business School FT 2004 MBA Exchange Participant to Rotman
[Martin - can you please start a new thread with a new Subject: header when you start a new topic? It makes things much easier to follow and to find later on. Thanks.]
On Thu 11 Dec 2003, Martin@Cleaver.org wrote:
1 Does wiki-toolkit.org show all the functionality of the toolkit?
No. wiki-toolkit.org is running on CGI::Wiki::Kwiki, which is an application built using various CPAN distributions including CGI::Wiki and the Template toolkit. It doesn't use "all" the features of either distribution. In particular it doesn't make much use of CGI::Wiki metadata.
I'm not quite clear on the line between this and the open guides stuff.
OpenGuides is a separate application, also built using CGI::Wiki.
CGI::Wiki is a toolkit. You use it to build applications. These applications may be related or may have nothing to do with each other.
2 Was the name Wiki::Toolkit ratified by the CPAN people?
I've tried twice to register the namespace using PAUSE, but nothing seems to have happened. Registration doesn't mean much other than as a notification to other people that you intend to upload something into that namespace though.
Kake
On Dec 11, 2003, at 17:29, Martin@Cleaver.org wrote:
2 Was the name Wiki::Toolkit ratified by the CPAN people?
Only 25% of CPAN is in a registered namespace. I don't really think anyone actually cares...
Actually, I know no-one cares.
.tom
----- Original Message ----- From: "Kate L Pugh" kake@earth.li To: cgi-wiki-dev@earth.li Sent: 11 December 2003 11:33 Subject: Re: [cgi-wiki-dev] CGI-Wiki-Kwiki-0.45 with added diffs, please test
On Thu 11 Dec 2003, Ivor Williams ivor.williams@tiscali.co.uk wrote:
I noticed a couple of points after I submitted the patch. There is an error in the template, differences.tt - it should be referring to variables [% left_version %] and [% right_version %] not [% ver1 %] and [% ver2 %].
I fixed that by setting ver1 and ver2 before calling the template.
Also, there are stylesheet entries needed to see the diff in full glorious technicolour:
Perhaps the default style in header.tt should include these, and the documentation should mention that these should be included in the stylesheet.
Yes, that might be good. Earle, you're the CSS expert - is it evil to put style directives in the HTML itself, or is it OK because an external stylesheet will always override them?
I'm also looking at and writing more tests for CGI::Wiki::Plugin::Diff.
Cool. Can we get OpenGuides::Diff using this plugin too?
I fully intend to, as I have no intention of maintaining two pieces of code that serve exactly the same purpose :).
The plan is to make obsolete OpenGuides::Diff.pm, and make OpenGuides.pm use the plugin. How do you make something obsolete in CVS? I can remove the file from the MANIFEST, which will sort out future release kits.
Ivor.
On Fri 12 Dec 2003, Ivor Williams ivor.williams@tiscali.co.uk wrote:
How do you make something obsolete in CVS?
rm lib/OpenGuides/Diff.pm cvs remove lib/OpenGuides/Diff.pm cvs commit -m"No longer used." lib/OpenGuides/Diff.pm
Kake
On Dec 10, 2003, at 15:19, Kate L Pugh wrote:
Nice work, thanks Ivor. I just installed it here at work and it seems mostly fine; just a couple of bugs that I shall try to iron out. I have applied the changes to CVS.
..which is now publicly available.
cvs -d :pserver:anoncvs@seatbelt.jerakeen.org:/var/lib/cvs co CGI-Wiki-Kwiki
should get you the current CVS source..
.tom
Excellent. Is this also live at http://wiki-toolkit.org? It's really time-consuming to have to work out what people added. Regards, M. -- Martin@Cleaver.org - +1 416 832 7759 Melbourne Business School FT 2004 MBA Exchange Participant to Rotman
=-----Original Message----- =From: Tom Insam [mailto:tom@jerakeen.org] =Sent: December 10, 2003 11:37 AM =To: cgi-wiki-dev@earth.li =Subject: Re: [cgi-wiki-dev] CGI-Wiki-Kwiki-0.45 with added diffs, please =test = = =On Dec 10, 2003, at 15:19, Kate L Pugh wrote: => Nice work, thanks Ivor. I just installed it here at work and it seems => mostly fine; just a couple of bugs that I shall try to iron out. I => have applied the changes to CVS. => = =..which is now publicly available. = =cvs -d :pserver:anoncvs@seatbelt.jerakeen.org:/var/lib/cvs co =CGI-Wiki-Kwiki = =should get you the current CVS source.. = =.tom = = =-- =http://www.earth.li/cgi-bin/mailman/listinfo/cgi-wiki-dev
On Dec 10, 2003, at 15:19, Kate L Pugh wrote:
Nice work, thanks Ivor. I just installed it here at work and it seems mostly fine; just a couple of bugs that I shall try to iron out. I have applied the changes to CVS.
On Wed 10 Dec 2003, Martin@Cleaver.org wrote:
Is this also live at http://wiki-toolkit.org?
It is now.
Kake