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