]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - IkiWiki/Plugin/skeleton.pm
rename the "render" hook to "change", which is clearer
[git.ikiwiki.info.git] / IkiWiki / Plugin / skeleton.pm
1 #!/usr/bin/perl
2 # Ikiwiki skeleton plugin. Replace "skeleton" with the name of your plugin
3 # in the lines below, remove hooks you don't use, and flesh out the code to
4 # make it do something.
5 package IkiWiki::Plugin::skeleton;
7 use warnings;
8 use strict;
9 use IkiWiki;
11 sub import { #{{{
12         IkiWiki::hook(type => "checkconfig", id => "skeleton", 
13                 call => \&checkconfig);
14         IkiWiki::hook(type => "preprocess", id => "skeleton", 
15                 call => \&preprocess);
16         IkiWiki::hook(type => "filter", id => "skeleton", 
17                 call => \&filter);
18         IkiWiki::hook(type => "delete", id => "skeleton", 
19                 call => \&delete);
20         IkiWiki::hook(type => "change", id => "skeleton", 
21                 call => \&change);
22         IkiWiki::hook(type => "cgi", id => "skeleton", 
23                 call => \&cgi);
24 } # }}}
26 sub checkconfig () { #{{{
27         IkiWiki::debug("skeleton plugin checkconfig");
28 } #}}}
30 sub preprocess (@) { #{{{
31         my %params=@_;
33         return "skeleton plugin result";
34 } # }}}
36 sub filter ($) { #{{{
37         my $content=shift;
38         
39         IkiWiki::debug("skeleton plugin running as filter");
41         return $content;
42 } # }}}
44 sub delete (@) { #{{{
45         my @files=@_;
47         IkiWiki::debug("skeleton plugin told that files were deleted: @files");
48 } #}}}
50 sub change (@) { #{{{
51         my @files=@_;
53         IkiWiki::debug("skeleton plugin told that changed files were rendered: @files");
54 } #}}}
56 sub cgi ($) { #{{{
57         my $cgi=shift;
59         IkiWiki::debug("skeleton plugin running in cgi");
60 } #}}}
62 1