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