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