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;
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 => \&renamepages);
41 hook(type => "savestate", id => "skeleton", call => \&savestate);
45 debug("skeleton plugin getopt");
57 description => "example option",
64 debug("skeleton plugin checkconfig");
68 debug("skeleton plugin refresh");
72 debug("skeleton plugin needsbuild");
78 return "skeleton plugin result";
84 debug("skeleton plugin running as filter");
86 return $params{content};
92 debug("skeleton plugin running as linkify");
94 return $params{content};
100 debug("skeleton plugin running as scan");
106 debug("skeleton plugin running as htmlize");
108 return $params{content};
114 debug("skeleton plugin running as a sanitizer");
116 return $params{content};
122 debug("skeleton plugin running as postscan");
128 debug("skeleton plugin running as a formatter");
130 return $params{content};
133 sub pagetemplate (@) {
135 my $page=$params{page};
136 my $template=$params{template};
138 debug("skeleton plugin running as a pagetemplate hook");
141 sub templatefile (@) {
143 my $page=$params{page};
145 debug("skeleton plugin running as a templatefile hook");
151 debug("skeleton plugin told that files were deleted: @files");
157 debug("skeleton plugin told that changed files were rendered: @files");
163 debug("skeleton plugin running in cgi");
170 debug("skeleton plugin running in auth");
173 sub sessioncgi ($$) {
177 debug("skeleton plugin running in sessioncgi");
185 debug("skeleton plugin running in canedit");
191 debug("skeleton plugin running in canremove");
197 debug("skeleton plugin running in canrename");
200 sub checkcontent (@) {
203 debug("skeleton plugin running in checkcontent");
206 sub editcontent ($$$) {
209 debug("skeleton plugin running in editcontent");
211 return $params{content};
214 sub formbuilder_setup (@) {
217 debug("skeleton plugin running in formbuilder_setup");
220 sub formbuilder (@) {
223 debug("skeleton plugin running in formbuilder");
229 debug("skeleton plugin running in renamepage");
232 sub renamepages ($$$) {
233 my ($torename, $cgi, $session) = (shift, shift, shift);
235 debug("skeleton plugin running in rename");
239 debug("skeleton plugin running in savestate");