2 package IkiWiki
::Plugin
::recentchangesdiff
;
12 hook
(type
=> "getsetup", id
=> "recentchangesdiff",
14 hook
(type
=> "pagetemplate", id
=> "recentchangesdiff",
15 call
=> \
&pagetemplate
);
26 sub pagetemplate
(@
) {
28 my $template=$params{template
};
29 if ($config{rcs
} && exists $params{rev
} && length $params{rev
} &&
30 $template->query(name
=> "diff")) {
31 my @lines=IkiWiki
::rcs_diff
($params{rev
}, $maxlines+1);
34 if (@lines > $maxlines) {
35 $diff=join("", @lines[0..($maxlines-1)])."\n".
36 gettext
("(Diff truncated)");
39 $diff=join("", @lines);
42 $diff = encode_entities
($diff);
43 # escape links and preprocessor stuff
44 $diff = encode_entities
($diff, '\[\]');
45 $template->param(diff
=> $diff);