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