2 package IkiWiki::Plugin::recentchangesdiff;
11 hook(type => "getsetup", id => "recentchangesdiff",
13 hook(type => "pagetemplate", id => "recentchangesdiff",
14 call => \&pagetemplate);
17 sub getsetup () { #{{{
25 sub pagetemplate (@) { #{{{
27 my $template=$params{template};
28 if ($config{rcs} && exists $params{rev} && length $params{rev} &&
29 $template->query(name => "diff")) {
30 my @lines=IkiWiki::rcs_diff($params{rev});
33 if (@lines > $maxlines) {
34 # only include so many lines of diff
35 $diff=join("", @lines[0..($maxlines-1)])."\n".
36 gettext("(Diff truncated)");
39 $diff=join("", @lines);
41 # escape links and preprocessor stuff
42 $diff =~ s/(?<!\\)\[\[/\\\[\[/g;
43 $template->param(diff => $diff);