wiki and not adding nonstandard markup. And it's not significantly hard to
type "--\[[Joey]]", and as to the date, we do have page history.
-## recentchanges links to commit diffs
-
-Would take a bit more viewcvs integration, let the be a "[diff]" link in
-recentchanges that goes to the diff for any listed change.
-
## recentchanges more than 100
Possibly add "next 100" link to it, but OTOH, you can just use svn log if
Specifies the url to the ikiwiki [[CGI]] script [[wrapper]]. Required when building the wiki for links to the cgi script to be generated.
-* --historyurl http://svn.someurl/trunk/[[]]?root=wiki
+* --historyurl http://svn.someurl/trunk/\[[file]]?root=wiki
- Specifies the url to link to for page history browsing. In the url, "[[]]" is replaced with the page to browse. It's common to use [[ViewCVS]] for this.
+ Specifies the url to link to for page history browsing. In the url,
+ "\[[file]]" is replaced with the file to browse. It's common to use
+ [[ViewCVS]] for this.
+
+* --diffurl http://svn.someurl/trunk/\[[file]]?root=wiki&r1=\[[r1]]&r2=\[[r2]]
+
+ Specifies the url to link to for a diff of changes to a page. In the url,
+ "\[[file]]" is replaced with the file to browse, "\[[r1]]" is the old
+ revision of the page, and "\[[r2]]" is the new revision. It's common to use
+ [[ViewCVS]] for this.
* --exclude regexp
# Holds global config settings, also used by some modules.
our %config=( #{{{
wiki_file_prune_regexp => qr{((^|/).svn/|\.\.|^\.|\/\.|\.html?$)},
- wiki_link_regexp => qr/\[\[([^\s]+)\]\]/,
+ wiki_link_regexp => qr/\[\[([^\s\]]+)\]\]/,
wiki_file_regexp => qr/(^[-A-Za-z0-9_.:\/+]+$)/,
verbose => 0,
wikiname => "wiki",
url => '',
cgiurl => '',
historyurl => '',
+ diffurl => '',
anonok => 0,
rebuild => 0,
wrapper => undef,
"url=s" => \$config{url},
"cgiurl=s" => \$config{cgiurl},
"historyurl=s" => \$config{historyurl},
+ "diffurl=s" => \$config{diffurl},
"exclude=s@" => sub {
$config{wiki_file_prune_regexp}=qr/$config{wiki_file_prune_regexp}|$_[1]/;
},
if (length $config{historyurl}) {
my $u=$config{historyurl};
- $u=~s/\[\[\]\]/$pagesources{$page}/g;
+ $u=~s/\[\[file\]\]/$pagesources{$page}/g;
$template->param(historyurl => $u);
}
$when=concise(ago(time - str2time($3)));
}
elsif ($state eq 'header' && /^\s+[A-Z]\s+\Q$svn_base\E\/([^ ]+)(?:$|\s)/) {
- push @pages, { link => htmllink("", pagename($1), 1) }
- if length $1;
+ my $file=$1;
+ my $diffurl=$config{diffurl};
+ $diffurl=~s/\[\[file\]\]/$file/g;
+ $diffurl=~s/\[\[r1\]\]/$rev - 1/eg;
+ $diffurl=~s/\[\[r2\]\]/$rev/g;
+ push @pages, {
+ link => htmllink("", pagename($file), 1),
+ diffurl => $diffurl,
+ } if length $file;
}
elsif ($state eq 'header' && /^$/) {
$state='body';
user => htmllink("", $user, 1),
committype => $committype,
when => $when, message => [@message],
- pages => [@pages] } if @pages;
+ pages => [@pages],
+ } if @pages;
return @ret if @ret >= $num;
$state='header';
push @params, "--url=$config{url}" if length $config{url};
push @params, "--cgiurl=$config{cgiurl}" if length $config{cgiurl};
push @params, "--historyurl=$config{historyurl}" if length $config{historyurl};
+ push @params, "--diffurl=$config{diffurl}" if length $config{diffurl};
push @params, "--anonok" if $config{anonok};
my $params=join(" ", @params);
my $call='';