| 1 |
w |
1.1 |
Name: |
| 2 |
|
|
Versions |
| 3 |
|
|
FullName: |
| 4 |
|
|
SuikaWiki: cooperation with version control systems |
| 5 |
|
|
URI: |
| 6 |
|
|
IW:SuikaWiki:SuikaWiki |
| 7 |
|
|
|
| 8 |
|
|
{ |
| 9 |
|
|
Name: |
| 10 |
|
|
wikiview/link-viewcvs |
| 11 |
|
|
FullName: |
| 12 |
|
|
LINK element referring ViewCVS page of the wiki page |
| 13 |
|
|
Format: |
| 14 |
|
|
$p->{href} .= $o->encode ($p->{page}||$o->{page}) . ($p->{suffix} || '.txt'); |
| 15 |
|
|
$r = qq(<link); |
| 16 |
|
|
for my $attr (qw/rel rev href class type hreflang charset/) { |
| 17 |
|
|
$r .= qq( $attr="@{[$o->escape($p->{$attr})]}") if $p->{$attr}; |
| 18 |
|
|
} |
| 19 |
|
|
for my $attr (qw/title/) { |
| 20 |
|
|
$r .= qq( $attr="@{[$o->formatter('view')->replace($p->{$attr},$o)]}") if $p->{$attr}; |
| 21 |
|
|
} |
| 22 |
|
|
$r .= '>'; |
| 23 |
|
|
} |
| 24 |
|
|
|
| 25 |
wakaba |
1.2 |
{ |
| 26 |
|
|
Name: |
| 27 |
|
|
wikiview/diff-between-previous |
| 28 |
|
|
FullName: |
| 29 |
|
|
Difference between previous version of this WikiPage |
| 30 |
|
|
Format: |
| 31 |
|
|
$r = qq(<pre class="diff">); |
| 32 |
|
|
for (split /\n/, $o->escape ($o->database->traverse_diff ($o->{page}))) { |
| 33 |
|
|
if (/^\+(.*)/) { |
| 34 |
|
|
$r .= qq(<ins class="added">$1</ins>\n); |
| 35 |
|
|
} elsif (/^\-(.*)/) { |
| 36 |
|
|
$r .= qq(<del class="deleted">$1</del>\n); |
| 37 |
|
|
} elsif (/^\=(.*)/) { |
| 38 |
|
|
$r .= qq(<span class="same">$1</span>\n); |
| 39 |
|
|
} else { |
| 40 |
|
|
$r .= qq|??? $_\n|; |
| 41 |
|
|
} |
| 42 |
|
|
} |
| 43 |
|
|
$r .= qq(</pre>); |
| 44 |
|
|
} |
| 45 |
|
|
|
| 46 |
|
|
MODULE: |
| 47 |
|
|
SuikaWiki::View->definition ('diff')->properties ( |
| 48 |
|
|
{media => {type => 'text/html', charset => 1, expires => 120}, |
| 49 |
|
|
#xmedia => {type => 'application/xhtml+xml', charset => 1, expires => 120}, |
| 50 |
|
|
template => <<EOH}); |
| 51 |
|
|
%html-start;%html-head(title=>"%res(name=>\\"Diff:WebPageTitle\\");"p,link_meta=>"%predefined-template(name=>links);"p); |
| 52 |
|
|
%section(level=>1,add_to_toc=>0,type=>body,title=>"%ns-short-page-name;",heading,content=>" |
| 53 |
|
|
%section(id=>tools1,class=>tools,add_to_toc=>0,content=>\\"%predefined-template(name=>navbar);\\"p); |
| 54 |
|
|
%section(level=>2,id=>\\"diff\\",title=>\\"Diff:Title\\",heading,content=>\\" |
| 55 |
|
|
<p>%res(name=>\\\\\\"Diff:Notice\\\\\\");</p> |
| 56 |
|
|
%diff-between-previous; |
| 57 |
|
|
\\"); |
| 58 |
|
|
%section(level=>2,id=>toc,title=>\\"TOC:Title\\",heading,add_to_toc=>0,content=>\\"%toc(drag);\\"); |
| 59 |
|
|
%section(class=>tools,add_to_toc=>0,content=>\\\"%predefined-template(name=>navbar);\\"p); |
| 60 |
|
|
%section(id=>footer,add-to-toc=>0,content=>\\"%predefined-template(name=>footer);\\"); |
| 61 |
|
|
"); |
| 62 |
|
|
EOH |
| 63 |
|
|
|
| 64 |
|
|
my $l = SuikaWiki::View->template ('links'); |
| 65 |
|
|
$l .= <<'EOH'; |
| 66 |
wakaba |
1.3 |
%link-wiki(mode=>diff,rel=>history,class=>wiki-cmd,title=>"%res(name=>ViewDiffOfThisPageLink);"p); |
| 67 |
wakaba |
1.2 |
EOH |
| 68 |
|
|
|
| 69 |
|
|
my $cvsuri = SuikaWiki::Plugin->uri ('cvs_repository'); |
| 70 |
|
|
$l .= <<EOH if $cvsuri; |
| 71 |
|
|
%link-viewcvs(href=>"$cvsuri",rel=>history,class=>wiki-cmd,title=>"%res(name=>ViewHistoryOfThisPageLink);",hreflang=>en); |
| 72 |
|
|
EOH |
| 73 |
|
|
|
| 74 |
w |
1.1 |
POD:LICENSE: |
| 75 |
|
|
Copyright 2003 Wakaba <w@suika.fam.cx> |
| 76 |
|
|
|
| 77 |
|
|
%%GNUGPL2%% |