ikiwiki/IkiWiki/Plugin/skeleton.pm.example

273 lines
5.8 KiB
Plaintext
Raw Normal View History

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