]> scripts.mit.edu Git - www/ikiwiki.git/blob - IkiWiki/Plugin/skeleton.pm
* Switch pagetemplate hooks to using named parameters.
[www/ikiwiki.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;
6
7 use warnings;
8 use strict;
9 use IkiWiki;
10
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 => "htmlize", id => "skeleton",
19                 call => \&htmlize);
20         IkiWiki::hook(type => "sanitize", id => "skeleton", 
21                 call => \&sanitize);
22         IkiWiki::hook(type => "pagetemplate", id => "skeleton", 
23                 call => \&pagetemplate);
24         IkiWiki::hook(type => "delete", id => "skeleton", 
25                 call => \&delete);
26         IkiWiki::hook(type => "change", id => "skeleton", 
27                 call => \&change);
28         IkiWiki::hook(type => "cgi", id => "skeleton", 
29                 call => \&cgi);
30 } # }}}
31
32 sub checkconfig () { #{{{
33         IkiWiki::debug("skeleton plugin checkconfig");
34 } #}}}
35
36 sub preprocess (@) { #{{{
37         my %params=@_;
38
39         return "skeleton plugin result";
40 } # }}}
41
42 sub filter (@) { #{{{
43         my %params=@_;
44         
45         IkiWiki::debug("skeleton plugin running as filter");
46
47         return $params{content};
48 } # }}}
49
50 sub htmlize ($) { #{{{
51         my $content=shift;
52
53         IkiWiki::debug("skeleton plugin running as htmlize");
54
55         return $content;
56 } # }}}
57
58 sub sanitize ($) { #{{{
59         my $content=shift;
60         
61         IkiWiki::debug("skeleton plugin running as a sanitizer");
62
63         return $content;
64 } # }}}
65
66 sub pagetemplate (@) { #{{{
67         my %params=@_;
68         my $page=$params{page};
69         my $template=$params{template};
70         
71         IkiWiki::debug("skeleton plugin running as a pagetemplate hook");
72 } # }}}
73
74 sub delete (@) { #{{{
75         my @files=@_;
76
77         IkiWiki::debug("skeleton plugin told that files were deleted: @files");
78 } #}}}
79
80 sub change (@) { #{{{
81         my @files=@_;
82
83         IkiWiki::debug("skeleton plugin told that changed files were rendered: @files");
84 } #}}}
85
86 sub cgi ($) { #{{{
87         my $cgi=shift;
88
89         IkiWiki::debug("skeleton plugin running in cgi");
90 } #}}}
91
92 1