]> sipb.mit.edu Git - ikiwiki.git/blob - IkiWiki/Plugin/skeleton.pm
* Reorganised the doc wiki's todo/* pages, using a link/tag to flag
[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 => "sanitize", id => "skeleton", 
19                 call => \&sanitize);
20         IkiWiki::hook(type => "pagetemplate", id => "skeleton", 
21                 call => \&pagetemplate);
22         IkiWiki::hook(type => "delete", id => "skeleton", 
23                 call => \&delete);
24         IkiWiki::hook(type => "change", id => "skeleton", 
25                 call => \&change);
26         IkiWiki::hook(type => "cgi", id => "skeleton", 
27                 call => \&cgi);
28 } # }}}
29
30 sub checkconfig () { #{{{
31         IkiWiki::debug("skeleton plugin checkconfig");
32 } #}}}
33
34 sub preprocess (@) { #{{{
35         my %params=@_;
36
37         return "skeleton plugin result";
38 } # }}}
39
40 sub filter (@) { #{{{
41         my %params=@_;
42         
43         IkiWiki::debug("skeleton plugin running as filter");
44
45         return $params{content};
46 } # }}}
47
48 sub sanitize ($) { #{{{
49         my $content=shift;
50         
51         IkiWiki::debug("skeleton plugin running as a sanitizer");
52
53         return $content;
54 } # }}}
55
56 sub pagetemplate ($$) { #{{{
57         my $page=shift;
58         my $template=shift;
59         
60         IkiWiki::debug("skeleton plugin running as a pagetemplate hook");
61 } # }}}
62
63 sub delete (@) { #{{{
64         my @files=@_;
65
66         IkiWiki::debug("skeleton plugin told that files were deleted: @files");
67 } #}}}
68
69 sub change (@) { #{{{
70         my @files=@_;
71
72         IkiWiki::debug("skeleton plugin told that changed files were rendered: @files");
73 } #}}}
74
75 sub cgi ($) { #{{{
76         my $cgi=shift;
77
78         IkiWiki::debug("skeleton plugin running in cgi");
79 } #}}}
80
81 1