aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Render.pm
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-08-28 18:17:59 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-08-28 18:17:59 +0000
commit4895955ceaf264c5f17b10c4009e1ab1afcc55ee (patch)
tree4f8553a9007b263e0b44afd0b9d0cbe8b5cf7b88 /IkiWiki/Render.pm
parente3a6ff004474cacb3e7a69a37696a65ebf1e2fcd (diff)
downloadikiwiki-4895955ceaf264c5f17b10c4009e1ab1afcc55ee.tar
ikiwiki-4895955ceaf264c5f17b10c4009e1ab1afcc55ee.tar.gz
* Change htmlize, format, and sanitize hooks to use named parameters.
Diffstat (limited to 'IkiWiki/Render.pm')
-rw-r--r--IkiWiki/Render.pm20
1 files changed, 15 insertions, 5 deletions
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
index 58556148f..ca6e9666b 100644
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
@@ -20,19 +20,26 @@ sub linkify ($$$) { #{{{
return $content;
} #}}}
-sub htmlize ($$) { #{{{
+sub htmlize ($$$) { #{{{
+ my $page=shift;
my $type=shift;
my $content=shift;
if (exists $hooks{htmlize}{$type}) {
- $content=$hooks{htmlize}{$type}{call}->($content);
+ $content=$hooks{htmlize}{$type}{call}->(
+ page => $page,
+ content => $content,
+ );
}
else {
error("htmlization of $type not supported");
}
run_hooks(sanitize => sub {
- $content=shift->($content);
+ $content=shift->(
+ page => $page,
+ content => $content,
+ );
});
return $content;
@@ -209,7 +216,10 @@ sub genpage ($$$) { #{{{
$content=$template->output;
run_hooks(format => sub {
- $content=shift->($content);
+ $content=shift->(
+ page => $page,
+ content => $content,
+ );
});
return $content;
@@ -287,7 +297,7 @@ sub render ($) { #{{{
$content=preprocess($page, $page, $content);
$content=linkify($page, $page, $content);
- $content=htmlize($type, $content);
+ $content=htmlize($page, $type, $content);
check_overwrite("$config{destdir}/".htmlpage($page), $page);
writefile(htmlpage($page), $config{destdir},