rename the "render" hook to "change", which is clearer

master
joey 2006-05-05 05:10:00 +00:00
parent 13f8a835a0
commit 157df8591f
4 changed files with 18 additions and 17 deletions

View File

@ -11,8 +11,8 @@ sub import { #{{{
call => \&checkconfig);
IkiWiki::hook(type => "delete", id => "hyperestraier",
call => \&delete);
IkiWiki::hook(type => "render", id => "hyperestraier",
call => \&render);
IkiWiki::hook(type => "change", id => "hyperestraier",
call => \&change);
IkiWiki::hook(type => "cgi", id => "hyperestraier",
call => \&cgi);
} # }}}
@ -41,7 +41,7 @@ sub delete (@) { #{{{
IkiWiki::estcfg();
} #}}}
sub render (@) { #{{{
sub change (@) { #{{{
IkiWiki::debug("updating hyperestraier search index");
IkiWiki::estcmd("gather -cm -bc -cl -sd",
map {

View File

@ -17,8 +17,8 @@ sub import { #{{{
call => \&filter);
IkiWiki::hook(type => "delete", id => "skeleton",
call => \&delete);
IkiWiki::hook(type => "render", id => "skeleton",
call => \&render);
IkiWiki::hook(type => "change", id => "skeleton",
call => \&change);
IkiWiki::hook(type => "cgi", id => "skeleton",
call => \&cgi);
} # }}}
@ -47,10 +47,10 @@ sub delete (@) { #{{{
IkiWiki::debug("skeleton plugin told that files were deleted: @files");
} #}}}
sub render (@) { #{{{
sub change (@) { #{{{
my @files=@_;
IkiWiki::debug("skeleton plugin told that files were rendered: @files");
IkiWiki::debug("skeleton plugin told that changed files were rendered: @files");
} #}}}
sub cgi ($) { #{{{

View File

@ -477,9 +477,9 @@ FILE: foreach my $file (@files) {
$hooks{delete}{$id}{call}->(@del);
}
}
if (%rendered && exists $hooks{render}) {
foreach my $id (keys %{$hooks{render}}) {
$hooks{render}{$id}{call}->(keys %rendered);
if (%rendered && exists $hooks{change}) {
foreach my $id (keys %{$hooks{change}}) {
$hooks{change}{$id}{call}->(keys %rendered);
}
}
} #}}}

View File

@ -49,10 +49,11 @@ return the error message as the output of the plugin.
### Html issues
Note that if [[HTMLSanitization]] is enabled, html in
Note that if [[HTMLSanitization]] is enabled, html in
[[PreProcessorDirective]] output is sanitised, which may limit what your
plugin can do. Also, the rest of the page content is not in html format at
preprocessor time. Text output by a preprocessor directive will be passed through markdown along with the rest of the page.
preprocessor time. Text output by a preprocessor directive will be passed
through markdown along with the rest of the page.
## Other types of hooks
@ -83,13 +84,13 @@ make arbitrary changes. The function is passed named parameters `page` and
Each time a page or pages is removed from the wiki, the referenced function
is called, and passed the names of the source files that were removed.
### render
### change
IkiWiki::hook(type => "render", id => "foo", call => \&render);
IkiWiki::hook(type => "change", id => "foo", call => \&render);
Each time ikiwiki renders a change or addition (but not deletion) of a page
to the wiki, the referenced function is called, and passed the name of the
source file that was rendered.
Each time ikiwiki renders a change or addition (but not deletion) to the
wiki, the referenced function is called, and passed the names of the
source files that were rendered.
### cgi