2006-05-02 04:34:33 +02:00
|
|
|
#!/usr/bin/perl
|
|
|
|
# Ikiwiki skeleton plugin. Replace "skeleton" with the name of your plugin
|
2006-05-03 23:50:39 +02:00
|
|
|
# in the lines below, remove hooks you don't use, and flesh out the code to
|
|
|
|
# make it do something.
|
2006-05-02 04:34:33 +02:00
|
|
|
package IkiWiki::Plugin::skeleton;
|
|
|
|
|
|
|
|
use warnings;
|
|
|
|
use strict;
|
2009-01-07 21:01:43 +01:00
|
|
|
use IkiWiki 3.00;
|
2006-05-02 04:34:33 +02:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub import {
|
2006-09-10 00:50:27 +02:00
|
|
|
hook(type => "getopt", id => "skeleton", call => \&getopt);
|
2008-07-26 06:38:13 +02:00
|
|
|
hook(type => "getsetup", id => "skeleton", call => \&getsetup);
|
2006-09-10 00:50:27 +02:00
|
|
|
hook(type => "checkconfig", id => "skeleton", call => \&checkconfig);
|
2008-07-29 21:04:34 +02:00
|
|
|
hook(type => "refresh", id => "skeleton", call => \&refresh);
|
2007-05-09 02:48:09 +02:00
|
|
|
hook(type => "needsbuild", id => "skeleton", call => \&needsbuild);
|
2006-09-10 00:50:27 +02:00
|
|
|
hook(type => "preprocess", id => "skeleton", call => \&preprocess);
|
|
|
|
hook(type => "filter", id => "skeleton", call => \&filter);
|
2008-02-12 04:48:27 +01:00
|
|
|
hook(type => "linkify", id => "skeleton", call => \&linkify);
|
|
|
|
hook(type => "scan", id => "skeleton", call => \&scan);
|
2006-09-10 00:50:27 +02:00
|
|
|
hook(type => "htmlize", id => "skeleton", call => \&htmlize);
|
|
|
|
hook(type => "sanitize", id => "skeleton", call => \&sanitize);
|
2010-05-07 05:07:08 +02:00
|
|
|
hook(type => "indexhtml", id => "skeleton", call => \&indexhtml);
|
2006-09-10 00:50:27 +02:00
|
|
|
hook(type => "format", id => "skeleton", call => \&format);
|
|
|
|
hook(type => "pagetemplate", id => "skeleton", call => \&pagetemplate);
|
2007-07-26 22:50:55 +02:00
|
|
|
hook(type => "templatefile", id => "skeleton", call => \&templatefile);
|
2010-05-03 18:15:40 +02:00
|
|
|
hook(type => "pageactions", id => "skeleton", call => \&pageactions);
|
2006-09-10 00:50:27 +02:00
|
|
|
hook(type => "delete", id => "skeleton", call => \&delete);
|
|
|
|
hook(type => "change", id => "skeleton", call => \&change);
|
|
|
|
hook(type => "cgi", id => "skeleton", call => \&cgi);
|
2006-11-20 02:52:18 +01:00
|
|
|
hook(type => "auth", id => "skeleton", call => \&auth);
|
2007-08-06 00:07:32 +02:00
|
|
|
hook(type => "sessioncgi", id => "skeleton", call => \&sessioncgi);
|
2007-02-02 03:33:03 +01:00
|
|
|
hook(type => "canedit", id => "skeleton", call => \&canedit);
|
2009-01-26 20:00:28 +01:00
|
|
|
hook(type => "canremove", id => "skeleton", call => \&canremove);
|
|
|
|
hook(type => "canrename", id => "skeleton", call => \&canrename);
|
2009-01-17 03:07:40 +01:00
|
|
|
hook(type => "checkcontent", id => "skeleton", call => \&checkcontent);
|
2007-08-26 23:33:25 +02:00
|
|
|
hook(type => "editcontent", id => "skeleton", call => \&editcontent);
|
2006-11-20 21:37:27 +01:00
|
|
|
hook(type => "formbuilder_setup", id => "skeleton", call => \&formbuilder_setup);
|
|
|
|
hook(type => "formbuilder", id => "skeleton", call => \&formbuilder);
|
2009-01-27 00:00:00 +01:00
|
|
|
hook(type => "renamepage", id => "skeleton", call => \&renamepage);
|
2009-01-27 01:13:15 +01:00
|
|
|
hook(type => "rename", id => "skeleton", call => \&rename);
|
2007-07-28 22:53:51 +02:00
|
|
|
hook(type => "savestate", id => "skeleton", call => \&savestate);
|
2009-09-10 20:04:46 +02:00
|
|
|
hook(type => "genwrapper", id => "skeleton", call => \&genwrapper);
|
2010-07-26 22:24:17 +02:00
|
|
|
hook(type => "disable", id => "skeleton", call => \&disable);
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2006-05-02 04:34:33 +02:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub getopt () {
|
2006-09-10 00:50:27 +02:00
|
|
|
debug("skeleton plugin getopt");
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2006-07-28 07:26:49 +02:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub getsetup () {
|
2008-07-26 06:38:13 +02:00
|
|
|
return
|
2008-08-04 01:35:35 +02:00
|
|
|
plugin => {
|
|
|
|
safe => 1,
|
|
|
|
rebuild => undef,
|
2010-07-14 20:47:17 +02:00
|
|
|
section => "misc",
|
2008-08-04 01:35:35 +02:00
|
|
|
},
|
2008-07-26 06:38:13 +02:00
|
|
|
skeleton => {
|
|
|
|
type => "boolean",
|
2008-07-27 03:07:15 +02:00
|
|
|
example => 0,
|
2008-07-26 06:38:13 +02:00
|
|
|
description => "example option",
|
|
|
|
safe => 0,
|
|
|
|
rebuild => 0,
|
|
|
|
},
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2008-07-26 06:38:13 +02:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub checkconfig () {
|
2006-09-10 00:50:27 +02:00
|
|
|
debug("skeleton plugin checkconfig");
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2006-05-03 23:50:39 +02:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub refresh () {
|
2008-07-29 21:04:34 +02:00
|
|
|
debug("skeleton plugin refresh");
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2008-07-29 21:04:34 +02:00
|
|
|
|
2010-06-18 22:15:57 +02:00
|
|
|
sub needsbuild ($) {
|
2010-09-07 18:08:59 +02:00
|
|
|
my $needsbuild=shift;
|
|
|
|
|
2007-05-09 02:48:09 +02:00
|
|
|
debug("skeleton plugin needsbuild");
|
2010-09-07 18:08:59 +02:00
|
|
|
|
|
|
|
return $needsbuild;
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2007-05-09 02:48:09 +02:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub preprocess (@) {
|
2006-05-02 04:34:33 +02:00
|
|
|
my %params=@_;
|
|
|
|
|
|
|
|
return "skeleton plugin result";
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2006-05-02 04:34:33 +02:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub filter (@) {
|
2006-05-05 07:41:11 +02:00
|
|
|
my %params=@_;
|
2006-05-04 06:29:37 +02:00
|
|
|
|
2006-09-10 00:50:27 +02:00
|
|
|
debug("skeleton plugin running as filter");
|
2006-05-04 06:29:37 +02:00
|
|
|
|
2006-05-05 07:41:11 +02:00
|
|
|
return $params{content};
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2006-05-05 07:41:11 +02:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub linkify (@) {
|
2008-02-12 04:48:27 +01:00
|
|
|
my %params=@_;
|
|
|
|
|
|
|
|
debug("skeleton plugin running as linkify");
|
|
|
|
|
|
|
|
return $params{content};
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2008-02-12 04:48:27 +01:00
|
|
|
|
2009-01-06 21:26:46 +01:00
|
|
|
sub scan (@) {
|
2008-02-12 04:48:27 +01:00
|
|
|
my %params=@_;
|
|
|
|
|
|
|
|
debug("skeleton plugin running as scan");
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2008-02-12 04:48:27 +01:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub htmlize (@) {
|
2006-08-28 20:17:59 +02:00
|
|
|
my %params=@_;
|
2006-07-04 00:42:11 +02:00
|
|
|
|
2006-09-10 00:50:27 +02:00
|
|
|
debug("skeleton plugin running as htmlize");
|
2006-07-04 00:42:11 +02:00
|
|
|
|
2006-08-28 20:17:59 +02:00
|
|
|
return $params{content};
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2006-07-04 00:42:11 +02:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub sanitize (@) {
|
2006-08-28 20:17:59 +02:00
|
|
|
my %params=@_;
|
2006-05-05 07:41:11 +02:00
|
|
|
|
2006-09-10 00:50:27 +02:00
|
|
|
debug("skeleton plugin running as a sanitizer");
|
2006-05-05 07:41:11 +02:00
|
|
|
|
2006-08-28 20:17:59 +02:00
|
|
|
return $params{content};
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2006-05-04 06:29:37 +02:00
|
|
|
|
2010-05-07 05:07:08 +02:00
|
|
|
sub indexhtml (@) {
|
2008-07-17 21:16:56 +02:00
|
|
|
my %params=@_;
|
|
|
|
|
2010-05-07 05:07:08 +02:00
|
|
|
debug("skeleton plugin running as indexhtml");
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2008-07-17 21:16:56 +02:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub format (@) {
|
2006-08-28 20:17:59 +02:00
|
|
|
my %params=@_;
|
2006-08-28 09:40:20 +02:00
|
|
|
|
2006-09-10 00:50:27 +02:00
|
|
|
debug("skeleton plugin running as a formatter");
|
2006-08-28 09:40:20 +02:00
|
|
|
|
2006-08-28 20:17:59 +02:00
|
|
|
return $params{content};
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2006-08-28 09:40:20 +02:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub pagetemplate (@) {
|
2006-07-28 01:41:58 +02:00
|
|
|
my %params=@_;
|
|
|
|
my $page=$params{page};
|
|
|
|
my $template=$params{template};
|
2006-05-26 03:10:58 +02:00
|
|
|
|
2006-09-10 00:50:27 +02:00
|
|
|
debug("skeleton plugin running as a pagetemplate hook");
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2006-05-26 03:10:58 +02:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub templatefile (@) {
|
2007-07-26 22:50:55 +02:00
|
|
|
my %params=@_;
|
|
|
|
my $page=$params{page};
|
|
|
|
|
|
|
|
debug("skeleton plugin running as a templatefile hook");
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2007-07-26 22:50:55 +02:00
|
|
|
|
2010-05-03 18:15:40 +02:00
|
|
|
sub pageactions (@) {
|
|
|
|
my %params=@_;
|
|
|
|
my $page=$params{page};
|
|
|
|
|
|
|
|
debug("skeleton plugin running as a pageactions hook");
|
|
|
|
return ();
|
|
|
|
}
|
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub delete (@) {
|
2006-05-03 23:50:39 +02:00
|
|
|
my @files=@_;
|
|
|
|
|
2006-09-10 00:50:27 +02:00
|
|
|
debug("skeleton plugin told that files were deleted: @files");
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2006-05-03 23:50:39 +02:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub change (@) {
|
2006-05-03 23:50:39 +02:00
|
|
|
my @files=@_;
|
|
|
|
|
2006-09-10 00:50:27 +02:00
|
|
|
debug("skeleton plugin told that changed files were rendered: @files");
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2006-05-03 23:50:39 +02:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub cgi ($) {
|
2006-05-03 23:50:39 +02:00
|
|
|
my $cgi=shift;
|
|
|
|
|
2006-09-10 00:50:27 +02:00
|
|
|
debug("skeleton plugin running in cgi");
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2006-05-03 23:50:39 +02:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub auth ($$) {
|
2006-11-20 02:52:18 +01:00
|
|
|
my $cgi=shift;
|
|
|
|
my $session=shift;
|
|
|
|
|
|
|
|
debug("skeleton plugin running in auth");
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2006-11-20 02:52:18 +01:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub sessioncgi ($$) {
|
2007-08-06 00:07:32 +02:00
|
|
|
my $cgi=shift;
|
|
|
|
my $session=shift;
|
|
|
|
|
|
|
|
debug("skeleton plugin running in sessioncgi");
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2007-08-06 00:07:32 +02:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub canedit ($$$) {
|
2007-02-02 03:33:03 +01:00
|
|
|
my $page=shift;
|
|
|
|
my $cgi=shift;
|
|
|
|
my $session=shift;
|
|
|
|
|
|
|
|
debug("skeleton plugin running in canedit");
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2007-02-02 03:33:03 +01:00
|
|
|
|
2009-01-26 23:07:19 +01:00
|
|
|
sub canremove (@) {
|
|
|
|
my %params=@_;
|
2009-01-01 22:20:54 +01:00
|
|
|
|
|
|
|
debug("skeleton plugin running in canremove");
|
|
|
|
}
|
|
|
|
|
2009-01-26 23:02:31 +01:00
|
|
|
sub canrename (@) {
|
|
|
|
my %params=@_;
|
2009-01-01 22:20:54 +01:00
|
|
|
|
|
|
|
debug("skeleton plugin running in canrename");
|
2009-01-26 20:00:28 +01:00
|
|
|
}
|
2009-01-18 00:45:46 +01:00
|
|
|
|
2009-01-17 03:07:40 +01:00
|
|
|
sub checkcontent (@) {
|
|
|
|
my %params=@_;
|
|
|
|
|
|
|
|
debug("skeleton plugin running in checkcontent");
|
2009-01-01 19:48:27 +01:00
|
|
|
}
|
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub editcontent ($$$) {
|
2007-08-26 23:33:25 +02:00
|
|
|
my %params=@_;
|
|
|
|
|
|
|
|
debug("skeleton plugin running in editcontent");
|
|
|
|
|
|
|
|
return $params{content};
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2007-08-26 23:33:25 +02:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub formbuilder_setup (@) {
|
2006-11-20 21:37:27 +01:00
|
|
|
my %params=@_;
|
|
|
|
|
|
|
|
debug("skeleton plugin running in formbuilder_setup");
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2006-11-20 21:37:27 +01:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub formbuilder (@) {
|
2006-11-20 21:37:27 +01:00
|
|
|
my %params=@_;
|
|
|
|
|
|
|
|
debug("skeleton plugin running in formbuilder");
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2006-11-20 21:37:27 +01:00
|
|
|
|
2009-01-27 00:00:00 +01:00
|
|
|
sub renamepage (@) {
|
|
|
|
my %params=@_;
|
|
|
|
|
|
|
|
debug("skeleton plugin running in renamepage");
|
|
|
|
}
|
|
|
|
|
2009-01-27 16:57:52 +01:00
|
|
|
sub rename (@) {
|
|
|
|
my %params=@_;
|
2009-01-27 00:00:00 +01:00
|
|
|
|
|
|
|
debug("skeleton plugin running in rename");
|
|
|
|
}
|
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub savestate () {
|
2006-09-10 00:50:27 +02:00
|
|
|
debug("skeleton plugin running in savestate");
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2006-07-30 02:20:11 +02:00
|
|
|
|
2009-09-10 20:04:46 +02:00
|
|
|
sub genwrapper () {
|
|
|
|
debug("skeleton plugin running in genwrapper");
|
|
|
|
}
|
|
|
|
|
2010-08-02 15:27:52 +02:00
|
|
|
sub disable () {
|
2010-07-26 22:24:17 +02:00
|
|
|
debug("skeleton plugin running in disable");
|
|
|
|
}
|
|
|
|
|
2006-05-02 04:34:33 +02:00
|
|
|
1
|