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;
|
2006-05-02 08:53:33 +02:00
|
|
|
use IkiWiki;
|
2006-05-02 04:34:33 +02:00
|
|
|
|
|
|
|
sub import { #{{{
|
2006-07-28 07:26:49 +02:00
|
|
|
IkiWiki::hook(type => "getopt", id => "skeleton",
|
|
|
|
call => \&getopt);
|
2006-05-03 23:50:39 +02:00
|
|
|
IkiWiki::hook(type => "checkconfig", id => "skeleton",
|
|
|
|
call => \&checkconfig);
|
2006-05-03 21:58:58 +02:00
|
|
|
IkiWiki::hook(type => "preprocess", id => "skeleton",
|
|
|
|
call => \&preprocess);
|
2006-05-04 06:29:37 +02:00
|
|
|
IkiWiki::hook(type => "filter", id => "skeleton",
|
|
|
|
call => \&filter);
|
2006-07-04 00:42:11 +02:00
|
|
|
IkiWiki::hook(type => "htmlize", id => "skeleton",
|
|
|
|
call => \&htmlize);
|
2006-05-05 07:41:11 +02:00
|
|
|
IkiWiki::hook(type => "sanitize", id => "skeleton",
|
|
|
|
call => \&sanitize);
|
2006-05-26 03:10:58 +02:00
|
|
|
IkiWiki::hook(type => "pagetemplate", id => "skeleton",
|
|
|
|
call => \&pagetemplate);
|
2006-05-03 23:50:39 +02:00
|
|
|
IkiWiki::hook(type => "delete", id => "skeleton",
|
|
|
|
call => \&delete);
|
2006-05-05 07:10:00 +02:00
|
|
|
IkiWiki::hook(type => "change", id => "skeleton",
|
|
|
|
call => \&change);
|
2006-05-03 23:50:39 +02:00
|
|
|
IkiWiki::hook(type => "cgi", id => "skeleton",
|
|
|
|
call => \&cgi);
|
2006-07-30 06:31:08 +02:00
|
|
|
IkiWiki::hook(type => "savestate", id => "savestate",
|
2006-07-30 02:20:11 +02:00
|
|
|
call => \&savestate);
|
2006-05-02 04:34:33 +02:00
|
|
|
} # }}}
|
|
|
|
|
2006-07-28 07:26:49 +02:00
|
|
|
sub getopt () { #{{{
|
|
|
|
IkiWiki::debug("skeleton plugin getopt");
|
|
|
|
} #}}}
|
|
|
|
|
2006-05-03 23:50:39 +02:00
|
|
|
sub checkconfig () { #{{{
|
|
|
|
IkiWiki::debug("skeleton plugin checkconfig");
|
|
|
|
} #}}}
|
|
|
|
|
2006-05-02 04:34:33 +02:00
|
|
|
sub preprocess (@) { #{{{
|
|
|
|
my %params=@_;
|
|
|
|
|
|
|
|
return "skeleton plugin result";
|
|
|
|
} # }}}
|
|
|
|
|
2006-05-05 07:41:11 +02:00
|
|
|
sub filter (@) { #{{{
|
|
|
|
my %params=@_;
|
2006-05-04 06:29:37 +02:00
|
|
|
|
|
|
|
IkiWiki::debug("skeleton plugin running as filter");
|
|
|
|
|
2006-05-05 07:41:11 +02:00
|
|
|
return $params{content};
|
|
|
|
} # }}}
|
|
|
|
|
2006-07-04 00:42:11 +02:00
|
|
|
sub htmlize ($) { #{{{
|
|
|
|
my $content=shift;
|
|
|
|
|
|
|
|
IkiWiki::debug("skeleton plugin running as htmlize");
|
|
|
|
|
|
|
|
return $content;
|
|
|
|
} # }}}
|
|
|
|
|
2006-05-05 07:41:11 +02:00
|
|
|
sub sanitize ($) { #{{{
|
|
|
|
my $content=shift;
|
|
|
|
|
|
|
|
IkiWiki::debug("skeleton plugin running as a sanitizer");
|
|
|
|
|
2006-05-04 06:29:37 +02:00
|
|
|
return $content;
|
|
|
|
} # }}}
|
|
|
|
|
2006-07-28 01:41:58 +02:00
|
|
|
sub pagetemplate (@) { #{{{
|
|
|
|
my %params=@_;
|
|
|
|
my $page=$params{page};
|
|
|
|
my $template=$params{template};
|
2006-05-26 03:10:58 +02:00
|
|
|
|
|
|
|
IkiWiki::debug("skeleton plugin running as a pagetemplate hook");
|
|
|
|
} # }}}
|
|
|
|
|
2006-05-03 23:50:39 +02:00
|
|
|
sub delete (@) { #{{{
|
|
|
|
my @files=@_;
|
|
|
|
|
|
|
|
IkiWiki::debug("skeleton plugin told that files were deleted: @files");
|
|
|
|
} #}}}
|
|
|
|
|
2006-05-05 07:10:00 +02:00
|
|
|
sub change (@) { #{{{
|
2006-05-03 23:50:39 +02:00
|
|
|
my @files=@_;
|
|
|
|
|
2006-05-05 07:10:00 +02:00
|
|
|
IkiWiki::debug("skeleton plugin told that changed files were rendered: @files");
|
2006-05-03 23:50:39 +02:00
|
|
|
} #}}}
|
|
|
|
|
|
|
|
sub cgi ($) { #{{{
|
|
|
|
my $cgi=shift;
|
|
|
|
|
|
|
|
IkiWiki::debug("skeleton plugin running in cgi");
|
|
|
|
} #}}}
|
|
|
|
|
2006-07-30 02:20:11 +02:00
|
|
|
sub savestate () { #{{{
|
|
|
|
IkiWiki::debug("skeleton plugin running in savestate");
|
|
|
|
} #}}}
|
|
|
|
|
2006-05-02 04:34:33 +02:00
|
|
|
1
|