]> sipb.mit.edu Git - ikiwiki.git/blob - IkiWiki/Plugin/skeleton.pm
web commit by joey: fix format
[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 => "pagetemplate", id => "skeleton", 
25                 call => \&pagetemplate);
26         IkiWiki::hook(type => "delete", id => "skeleton", 
27                 call => \&delete);
28         IkiWiki::hook(type => "change", id => "skeleton", 
29                 call => \&change);
30         IkiWiki::hook(type => "cgi", id => "skeleton", 
31                 call => \&cgi);
32 } # }}}
33
34 sub getopt () { #{{{
35         IkiWiki::debug("skeleton plugin getopt");
36 } #}}}
37
38 sub checkconfig () { #{{{
39         IkiWiki::debug("skeleton plugin checkconfig");
40 } #}}}
41
42 sub preprocess (@) { #{{{
43         my %params=@_;
44
45         return "skeleton plugin result";
46 } # }}}
47
48 sub filter (@) { #{{{
49         my %params=@_;
50         
51         IkiWiki::debug("skeleton plugin running as filter");
52
53         return $params{content};
54 } # }}}
55
56 sub htmlize ($) { #{{{
57         my $content=shift;
58
59         IkiWiki::debug("skeleton plugin running as htmlize");
60
61         return $content;
62 } # }}}
63
64 sub sanitize ($) { #{{{
65         my $content=shift;
66         
67         IkiWiki::debug("skeleton plugin running as a sanitizer");
68
69         return $content;
70 } # }}}
71
72 sub pagetemplate (@) { #{{{
73         my %params=@_;
74         my $page=$params{page};
75         my $template=$params{template};
76         
77         IkiWiki::debug("skeleton plugin running as a pagetemplate hook");
78 } # }}}
79
80 sub delete (@) { #{{{
81         my @files=@_;
82
83         IkiWiki::debug("skeleton plugin told that files were deleted: @files");
84 } #}}}
85
86 sub change (@) { #{{{
87         my @files=@_;
88
89         IkiWiki::debug("skeleton plugin told that changed files were rendered: @files");
90 } #}}}
91
92 sub cgi ($) { #{{{
93         my $cgi=shift;
94
95         IkiWiki::debug("skeleton plugin running in cgi");
96 } #}}}
97
98 1