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 => "cansave", id => "skeleton", call => \&cansave);
34 hook(type => "checkcontent", id => "skeleton", call => \&checkcontent);
35 hook(type => "editcontent", id => "skeleton", call => \&editcontent);
36 hook(type => "formbuilder_setup", id => "skeleton", call => \&formbuilder_setup);
37 hook(type => "formbuilder", id => "skeleton", call => \&formbuilder);
38 hook(type => "savestate", id => "skeleton", call => \&savestate);
42 debug("skeleton plugin getopt");
54 description => "example option",
61 debug("skeleton plugin checkconfig");
65 debug("skeleton plugin refresh");
69 debug("skeleton plugin needsbuild");
75 return "skeleton plugin result";
81 debug("skeleton plugin running as filter");
83 return $params{content};
89 debug("skeleton plugin running as linkify");
91 return $params{content};
97 debug("skeleton plugin running as scan");
103 debug("skeleton plugin running as htmlize");
105 return $params{content};
111 debug("skeleton plugin running as a sanitizer");
113 return $params{content};
119 debug("skeleton plugin running as postscan");
125 debug("skeleton plugin running as a formatter");
127 return $params{content};
130 sub pagetemplate (@) {
132 my $page=$params{page};
133 my $template=$params{template};
135 debug("skeleton plugin running as a pagetemplate hook");
138 sub templatefile (@) {
140 my $page=$params{page};
142 debug("skeleton plugin running as a templatefile hook");
148 debug("skeleton plugin told that files were deleted: @files");
154 debug("skeleton plugin told that changed files were rendered: @files");
160 debug("skeleton plugin running in cgi");
167 debug("skeleton plugin running in auth");
170 sub sessioncgi ($$) {
174 debug("skeleton plugin running in sessioncgi");
182 debug("skeleton plugin running in canedit");
191 debug("skeleton plugin running in cansave");
194 sub canremove ($$$) {
199 debug("skeleton plugin running in canremove");
202 sub canrename ($$$) {
207 debug("skeleton plugin running in canrename");
209 sub checkcontent (@) {
212 debug("skeleton plugin running in checkcontent");
215 sub editcontent ($$$) {
218 debug("skeleton plugin running in editcontent");
220 return $params{content};
223 sub formbuilder_setup (@) {
226 debug("skeleton plugin running in formbuilder_setup");
229 sub formbuilder (@) {
232 debug("skeleton plugin running in formbuilder");
236 debug("skeleton plugin running in savestate");