]> sipb.mit.edu Git - ikiwiki.git/blob - IkiWiki/Plugin/skeleton.pm
remove the "0 new", it's not very useful
[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 => "getopt", id => "skeleton", 
13                 call => \&getopt);
14         IkiWiki::hook(type => "checkconfig", id => "skeleton", 
15                 call => \&checkconfig);
16         IkiWiki::hook(type => "preprocess", id => "skeleton", 
17                 call => \&preprocess);
18         IkiWiki::hook(type => "filter", id => "skeleton", 
19                 call => \&filter);
20         IkiWiki::hook(type => "htmlize", id => "skeleton",
21                 call => \&htmlize);
22         IkiWiki::hook(type => "sanitize", id => "skeleton", 
23                 call => \&sanitize);
24         IkiWiki::hook(type => "format", id => "skeleton", 
25                 call => \&format);
26         IkiWiki::hook(type => "pagetemplate", id => "skeleton", 
27                 call => \&pagetemplate);
28         IkiWiki::hook(type => "delete", id => "skeleton", 
29                 call => \&delete);
30         IkiWiki::hook(type => "change", id => "skeleton", 
31                 call => \&change);
32         IkiWiki::hook(type => "cgi", id => "skeleton", 
33                 call => \&cgi);
34         IkiWiki::hook(type => "savestate", id => "savestate", 
35                 call => \&savestate);
36 } # }}}
37
38 sub getopt () { #{{{
39         IkiWiki::debug("skeleton plugin getopt");
40 } #}}}
41
42 sub checkconfig () { #{{{
43         IkiWiki::debug("skeleton plugin checkconfig");
44 } #}}}
45
46 sub preprocess (@) { #{{{
47         my %params=@_;
48
49         return "skeleton plugin result";
50 } # }}}
51
52 sub filter (@) { #{{{
53         my %params=@_;
54         
55         IkiWiki::debug("skeleton plugin running as filter");
56
57         return $params{content};
58 } # }}}
59
60 sub htmlize (@) { #{{{
61         my %params=@_;
62
63         IkiWiki::debug("skeleton plugin running as htmlize");
64
65         return $params{content};
66 } # }}}
67
68 sub sanitize (@) { #{{{
69         my %params=@_;
70         
71         IkiWiki::debug("skeleton plugin running as a sanitizer");
72
73         return $params{content};
74 } # }}}
75
76 sub format (@) { #{{{
77         my %params=@_;
78         
79         IkiWiki::debug("skeleton plugin running as a formatter");
80
81         return $params{content};
82 } # }}}
83
84 sub pagetemplate (@) { #{{{
85         my %params=@_;
86         my $page=$params{page};
87         my $template=$params{template};
88         
89         IkiWiki::debug("skeleton plugin running as a pagetemplate hook");
90 } # }}}
91
92 sub delete (@) { #{{{
93         my @files=@_;
94
95         IkiWiki::debug("skeleton plugin told that files were deleted: @files");
96 } #}}}
97
98 sub change (@) { #{{{
99         my @files=@_;
100
101         IkiWiki::debug("skeleton plugin told that changed files were rendered: @files");
102 } #}}}
103
104 sub cgi ($) { #{{{
105         my $cgi=shift;
106
107         IkiWiki::debug("skeleton plugin running in cgi");
108 } #}}}
109
110 sub savestate () { #{{{
111         IkiWiki::debug("skeleton plugin running in savestate");
112 } #}}}
113
114 1