Name: Versions FullName: SuikaWiki: cooperation with version control systems URI: IW:SuikaWiki:SuikaWiki { Name: wikiview/link-viewcvs FullName: LINK element referring ViewCVS page of the wiki page Format: my $ename = $p->{page} || $o->{page}; $ename =~ s/(.)/sprintf '%%%02X', ord $1/ges; $ename =~ s!%2F%2F!.ns/!g; $ename =~ tr/%//d; $p->{href} .= $ename . ($p->{suffix} || '.txt'); $r = qq(escape($p->{$attr})]}") if $p->{$attr}; } for my $attr (qw/title/) { $r .= qq( $attr="@{[$o->formatter('view')->replace($p->{$attr},$o)]}") if $p->{$attr}; } $r .= ' />'; } { Name: wikiview/diff-between-previous FullName: Difference between previous version of this WikiPage Format: $r = qq(
);
for (split /\n/, $o->escape ($o->database->traverse_diff ($o->{page}))) {
if (/^\+(.*)/) {
$r .= qq($1\n);
} elsif (/^\-(.*)/) {
$r .= qq($1\n);
} elsif (/^\=(.*)/) {
$r .= qq($1\n);
} else {
$r .= qq|??? $_\n|;
}
}
$r .= qq();
}
MODULE:
SuikaWiki::View->definition ('diff')->properties (
{media => {type => 'text/html', charset => 1, expires => 120},
#xmedia => {type => 'application/xhtml+xml', charset => 1, expires => 120},
template => <%res(name=>\\\\\\"Diff:Notice\\\\\\");
%diff-between-previous; \\"); %section(level=>2,id=>toc,title=>\\"TOC:Title\\",heading,add_to_toc=>0,content=>\\"%toc(drag);\\"); %section(class=>tools,add_to_toc=>0,content=>\\\"%predefined-template(name=>navbar);\\"p); %section(id=>footer,add-to-toc=>0,content=>\\"%predefined-template(name=>footer);\\"); "); EOH my $l = SuikaWiki::View->template ('links'); $l .= <<'EOH'; %link-wiki(mode=>diff,rel=>history,class=>wiki-cmd,title=>"%res(name=>ViewDiffOfThisPageLink);"p); EOH my $cvsuri = SuikaWiki::Plugin->uri ('cvs_repository'); $l .= <