]> sipb.mit.edu Git - ikiwiki.git/blob - IkiWiki/Plugin/skeleton.pm.example
708d9283019a5e2dd2b806bd59315d88a13824e7
[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 => "rescan", id => "skeleton", call => \&rescan);
22         hook(type => "htmlize", id => "skeleton", call => \&htmlize);
23         hook(type => "sanitize", id => "skeleton", call => \&sanitize);
24         hook(type => "indexhtml", id => "skeleton", call => \&indexhtml);
25         hook(type => "format", id => "skeleton", call => \&format);
26         hook(type => "pagetemplate", id => "skeleton", call => \&pagetemplate);
27         hook(type => "templatefile", id => "skeleton", call => \&templatefile);
28         hook(type => "pageactions", id => "skeleton", call => \&pageactions);
29         hook(type => "delete", id => "skeleton", call => \&delete);
30         hook(type => "change", id => "skeleton", call => \&change);
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         debug("skeleton plugin needsbuild");
78 }
79
80 sub preprocess (@) {
81         my %params=@_;
82
83         return "skeleton plugin result";
84 }
85
86 sub filter (@) {
87         my %params=@_;
88         
89         debug("skeleton plugin running as filter");
90
91         return $params{content};
92 }
93
94 sub linkify (@) {
95         my %params=@_;
96         
97         debug("skeleton plugin running as linkify");
98
99         return $params{content};
100 }
101
102 sub scan (@) {
103         my %params=@_;
104
105         debug("skeleton plugin running as scan");
106 }
107
108 sub rescan (@) {
109         my %params=@_;
110
111         debug("skeleton plugin running as rescan");
112 }
113
114 sub htmlize (@) {
115         my %params=@_;
116
117         debug("skeleton plugin running as htmlize");
118
119         return $params{content};
120 }
121
122 sub sanitize (@) {
123         my %params=@_;
124         
125         debug("skeleton plugin running as a sanitizer");
126
127         return $params{content};
128 }
129
130 sub indexhtml (@) {
131         my %params=@_;
132         
133         debug("skeleton plugin running as indexhtml");
134 }
135
136 sub format (@) {
137         my %params=@_;
138         
139         debug("skeleton plugin running as a formatter");
140
141         return $params{content};
142 }
143
144 sub pagetemplate (@) {
145         my %params=@_;
146         my $page=$params{page};
147         my $template=$params{template};
148         
149         debug("skeleton plugin running as a pagetemplate hook");
150 }
151
152 sub templatefile (@) {
153         my %params=@_;
154         my $page=$params{page};
155         
156         debug("skeleton plugin running as a templatefile hook");
157 }
158
159 sub pageactions (@) {
160         my %params=@_;
161         my $page=$params{page};
162
163         debug("skeleton plugin running as a pageactions hook");
164         return ();
165 }
166
167 sub delete (@) {
168         my @files=@_;
169
170         debug("skeleton plugin told that files were deleted: @files");
171 }
172
173 sub change (@) {
174         my @files=@_;
175
176         debug("skeleton plugin told that changed files were rendered: @files");
177 }
178
179 sub cgi ($) {
180         my $cgi=shift;
181
182         debug("skeleton plugin running in cgi");
183 }
184
185 sub auth ($$) {
186         my $cgi=shift;
187         my $session=shift;
188
189         debug("skeleton plugin running in auth");
190 }
191
192 sub sessioncgi ($$) {
193         my $cgi=shift;
194         my $session=shift;
195
196         debug("skeleton plugin running in sessioncgi");
197 }
198
199 sub canedit ($$$) {
200         my $page=shift;
201         my $cgi=shift;
202         my $session=shift;
203
204         debug("skeleton plugin running in canedit");
205 }
206
207 sub canremove (@) {
208         my %params=@_;
209
210         debug("skeleton plugin running in canremove");
211 }
212
213 sub canrename (@) {
214         my %params=@_;
215
216         debug("skeleton plugin running in canrename");
217 }
218
219 sub checkcontent (@) {
220         my %params=@_;
221
222         debug("skeleton plugin running in checkcontent");
223 }
224
225 sub editcontent ($$$) {
226         my %params=@_;
227
228         debug("skeleton plugin running in editcontent");
229
230         return $params{content};
231 }
232
233 sub formbuilder_setup (@) {
234         my %params=@_;
235         
236         debug("skeleton plugin running in formbuilder_setup");
237 }
238
239 sub formbuilder (@) {
240         my %params=@_;
241         
242         debug("skeleton plugin running in formbuilder");
243 }
244
245 sub renamepage (@) {
246         my %params=@_;
247         
248         debug("skeleton plugin running in renamepage");
249 }
250
251 sub rename (@) {
252         my %params=@_;
253         
254         debug("skeleton plugin running in rename");
255 }
256
257 sub savestate () {
258         debug("skeleton plugin running in savestate");
259 }
260
261 sub genwrapper () {
262         debug("skeleton plugin running in genwrapper");
263 }
264
265 sub savestate () {
266         debug("skeleton plugin running in disable");
267 }
268
269 1