]> sipb.mit.edu Git - ikiwiki.git/blob - IkiWiki/Plugin/skeleton.pm
* Run page through any relevant filters when generating a page preview.
[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 $page=shift;
68         my $template=shift;
69         
70         IkiWiki::debug("skeleton plugin running as a pagetemplate hook");
71 } # }}}
72
73 sub delete (@) { #{{{
74         my @files=@_;
75
76         IkiWiki::debug("skeleton plugin told that files were deleted: @files");
77 } #}}}
78
79 sub change (@) { #{{{
80         my @files=@_;
81
82         IkiWiki::debug("skeleton plugin told that changed files were rendered: @files");
83 } #}}}
84
85 sub cgi ($) { #{{{
86         my $cgi=shift;
87
88         IkiWiki::debug("skeleton plugin running in cgi");
89 } #}}}
90
91 1