]> sipb.mit.edu Git - ikiwiki.git/blob - IkiWiki/Plugin/skeleton.pm.example
Merge remote branch 'intrigeri/po'
[ikiwiki.git] / IkiWiki / Plugin / skeleton.pm.example
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 3.00;
10
11 sub import {
12         hook(type => "getopt", id => "skeleton",  call => \&getopt);
13         hook(type => "getsetup", id => "skeleton",  call => \&getsetup);
14         hook(type => "checkconfig", id => "skeleton", call => \&checkconfig);
15         hook(type => "refresh", id => "skeleton", call => \&refresh);
16         hook(type => "needsbuild", id => "skeleton", call => \&needsbuild);
17         hook(type => "preprocess", id => "skeleton", call => \&preprocess);
18         hook(type => "filter", id => "skeleton", call => \&filter);
19         hook(type => "linkify", id => "skeleton", call => \&linkify);
20         hook(type => "scan", id => "skeleton", call => \&scan);
21         hook(type => "htmlize", id => "skeleton", call => \&htmlize);
22         hook(type => "sanitize", id => "skeleton", call => \&sanitize);
23         hook(type => "indexhtml", id => "skeleton", call => \&indexhtml);
24         hook(type => "format", id => "skeleton", call => \&format);
25         hook(type => "pagetemplate", id => "skeleton", call => \&pagetemplate);
26         hook(type => "templatefile", id => "skeleton", call => \&templatefile);
27         hook(type => "pageactions", id => "skeleton", call => \&pageactions);
28         hook(type => "delete", id => "skeleton", call => \&delete);
29         hook(type => "change", id => "skeleton", call => \&change);
30         hook(type => "cgi", id => "skeleton", call => \&cgi);
31         hook(type => "auth", id => "skeleton", call => \&auth);
32         hook(type => "sessioncgi", id => "skeleton", call => \&sessioncgi);
33         hook(type => "canedit", id => "skeleton", call => \&canedit);
34         hook(type => "canremove", id => "skeleton", call => \&canremove);
35         hook(type => "canrename", id => "skeleton", call => \&canrename);
36         hook(type => "checkcontent", id => "skeleton", call => \&checkcontent);
37         hook(type => "editcontent", id => "skeleton", call => \&editcontent);
38         hook(type => "formbuilder_setup", id => "skeleton", call => \&formbuilder_setup);
39         hook(type => "formbuilder", id => "skeleton", call => \&formbuilder);
40         hook(type => "renamepage", id => "skeleton", call => \&renamepage);
41         hook(type => "rename", id => "skeleton", call => \&rename);
42         hook(type => "savestate", id => "skeleton", call => \&savestate);
43         hook(type => "genwrapper", id => "skeleton", call => \&genwrapper);
44 }
45
46 sub getopt () {
47         debug("skeleton plugin getopt");
48 }
49
50 sub getsetup () {
51         return
52                 plugin => {
53                         safe => 1,
54                         rebuild => undef,
55                         section => "misc",
56                 },
57                 skeleton => {
58                         type => "boolean",
59                         example => 0,
60                         description => "example option",
61                         safe => 0,
62                         rebuild => 0,
63                 },
64 }
65
66 sub checkconfig () {
67         debug("skeleton plugin checkconfig");
68 }
69
70 sub refresh () {
71         debug("skeleton plugin refresh");
72 }
73
74 sub needsbuild ($) {
75         debug("skeleton plugin needsbuild");
76 }
77
78 sub preprocess (@) {
79         my %params=@_;
80
81         return "skeleton plugin result";
82 }
83
84 sub filter (@) {
85         my %params=@_;
86         
87         debug("skeleton plugin running as filter");
88
89         return $params{content};
90 }
91
92 sub linkify (@) {
93         my %params=@_;
94         
95         debug("skeleton plugin running as linkify");
96
97         return $params{content};
98 }
99
100 sub scan (@) {
101         my %params=@_;
102
103         debug("skeleton plugin running as scan");
104 }
105
106 sub htmlize (@) {
107         my %params=@_;
108
109         debug("skeleton plugin running as htmlize");
110
111         return $params{content};
112 }
113
114 sub sanitize (@) {
115         my %params=@_;
116         
117         debug("skeleton plugin running as a sanitizer");
118
119         return $params{content};
120 }
121
122 sub indexhtml (@) {
123         my %params=@_;
124         
125         debug("skeleton plugin running as indexhtml");
126 }
127
128 sub format (@) {
129         my %params=@_;
130         
131         debug("skeleton plugin running as a formatter");
132
133         return $params{content};
134 }
135
136 sub pagetemplate (@) {
137         my %params=@_;
138         my $page=$params{page};
139         my $template=$params{template};
140         
141         debug("skeleton plugin running as a pagetemplate hook");
142 }
143
144 sub templatefile (@) {
145         my %params=@_;
146         my $page=$params{page};
147         
148         debug("skeleton plugin running as a templatefile hook");
149 }
150
151 sub pageactions (@) {
152         my %params=@_;
153         my $page=$params{page};
154
155         debug("skeleton plugin running as a pageactions hook");
156         return ();
157 }
158
159 sub delete (@) {
160         my @files=@_;
161
162         debug("skeleton plugin told that files were deleted: @files");
163 }
164
165 sub change (@) {
166         my @files=@_;
167
168         debug("skeleton plugin told that changed files were rendered: @files");
169 }
170
171 sub cgi ($) {
172         my $cgi=shift;
173
174         debug("skeleton plugin running in cgi");
175 }
176
177 sub auth ($$) {
178         my $cgi=shift;
179         my $session=shift;
180
181         debug("skeleton plugin running in auth");
182 }
183
184 sub sessioncgi ($$) {
185         my $cgi=shift;
186         my $session=shift;
187
188         debug("skeleton plugin running in sessioncgi");
189 }
190
191 sub canedit ($$$) {
192         my $page=shift;
193         my $cgi=shift;
194         my $session=shift;
195
196         debug("skeleton plugin running in canedit");
197 }
198
199 sub canremove (@) {
200         my %params=@_;
201
202         debug("skeleton plugin running in canremove");
203 }
204
205 sub canrename (@) {
206         my %params=@_;
207
208         debug("skeleton plugin running in canrename");
209 }
210
211 sub checkcontent (@) {
212         my %params=@_;
213
214         debug("skeleton plugin running in checkcontent");
215 }
216
217 sub editcontent ($$$) {
218         my %params=@_;
219
220         debug("skeleton plugin running in editcontent");
221
222         return $params{content};
223 }
224
225 sub formbuilder_setup (@) {
226         my %params=@_;
227         
228         debug("skeleton plugin running in formbuilder_setup");
229 }
230
231 sub formbuilder (@) {
232         my %params=@_;
233         
234         debug("skeleton plugin running in formbuilder");
235 }
236
237 sub renamepage (@) {
238         my %params=@_;
239         
240         debug("skeleton plugin running in renamepage");
241 }
242
243 sub rename (@) {
244         my %params=@_;
245         
246         debug("skeleton plugin running in rename");
247 }
248
249 sub savestate () {
250         debug("skeleton plugin running in savestate");
251 }
252
253 sub genwrapper () {
254         debug("skeleton plugin running in genwrapper");
255 }
256
257 1