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