add plugin safe/rebuild info (part 3 of 3)

master
Joey Hess 2008-08-03 19:35:35 -04:00
parent 210b9ba2f3
commit 3905645342
22 changed files with 170 additions and 8 deletions

View File

@ -18,13 +18,6 @@ sub getsetup () { #{{{
safe => 1,
rebuild => 0,
},
virus_checker => {
type => "string",
example => "clamdscan -",
description => "virus checker program (reads STDIN, returns nonzero if virus found)",
safe => 0, # executed
rebuild => 0,
},
allowed_attachments => {
type => "pagespec",
example => "virusfree() and mimetype(image/*) and maxsize(50kb)",
@ -33,6 +26,13 @@ sub getsetup () { #{{{
safe => 1,
rebuild => 0,
},
virus_checker => {
type => "string",
example => "clamdscan -",
description => "virus checker program (reads STDIN, returns nonzero if virus found)",
safe => 0, # executed
rebuild => 0,
},
} #}}}
sub check_canattach ($$;$) { #{{{

View File

@ -6,10 +6,19 @@ use strict;
use IkiWiki 2.00;
sub import { #{{{
hook(type => "getsetup", id => "shortcut", call => \&getsetup);
hook(type => "refresh", id => "shortcut", call => \&refresh);
hook(type => "preprocess", id => "shortcut", call => \&preprocess_shortcut);
} #}}}
sub getsetup () { #{{{
return
plugin => {
safe => 1,
rebuild => undef,
},
} #}}}
sub refresh () { #{{{
# Preprocess the shortcuts page to get all the available shortcuts
# defined before other pages are rendered.

View File

@ -9,9 +9,18 @@ use strict;
use IkiWiki 2.00;
sub import { #{{{
hook(type => "getsetup", id => "sidebar", call => \&getsetup);
hook(type => "pagetemplate", id => "sidebar", call => \&pagetemplate);
} # }}}
sub getsetup () { #{{{
return
plugin => {
safe => 1,
rebuild => 1,
},
} #}}}
sub sidebar_content ($) { #{{{
my $page=shift;

View File

@ -6,10 +6,19 @@ use strict;
use IkiWiki 2.00;
sub import { #{{{
hook(type => "getsetup", id => "signinedit", call => \&getsetup);
hook(type => "canedit", id => "signinedit", call => \&canedit,
last => 1);
} # }}}
sub getsetup () { #{{{
return
plugin => {
safe => 1,
rebuild => 0,
},
} #}}}
sub canedit ($$$) { #{{{
my $page=shift;
my $cgi=shift;

View File

@ -42,6 +42,10 @@ sub getopt () { #{{{
sub getsetup () { #{{{
return
plugin => {
safe => 1,
rebuild => undef,
},
skeleton => {
type => "boolean",
example => 0,

View File

@ -10,9 +10,20 @@ my $smiley_regexp;
sub import { #{{{
add_underlay("smiley");
hook(type => "getsetup", id => "smiley", call => \&getsetup);
hook(type => "sanitize", id => "smiley", call => \&sanitize);
} # }}}
sub getsetup () { #{{{
return
plugin => {
safe => 1,
# force a rebuild because turning it off
# removes the smileys, which would break links
rebuild => 1,
},
} #}}}
sub build_regexp () { #{{{
my $list=readfile(srcfile("smileys.mdwn"));
while ($list =~ m/^\s*\*\s+\\\\([^\s]+)\s+\[\[([^]]+)\]\]/mg) {

View File

@ -15,9 +15,18 @@ my %locmap=(
);
sub import { #{{{
hook(type => "getsetup", id => "sparkline", call => \&getsetup);
hook(type => "preprocess", id => "sparkline", call => \&preprocess);
} # }}}
sub getsetup () { #{{{
return
plugin => {
safe => 1,
rebuild => undef,
},
} #}}}
sub preprocess (@) { #{{{
my %params=@_;

View File

@ -41,6 +41,10 @@ sub checkconfig () { #{{{
sub getsetup () { #{{{
return
plugin => {
safe => 0, # rcs plugin
rebuild => undef,
},
svnrepo => {
type => "string",
example => "/svn/wiki",

View File

@ -7,9 +7,18 @@ use Encode;
use IkiWiki 2.00;
sub import { #{{{
hook(type => "getsetup", id => "table", call => \&getsetup);
hook(type => "preprocess", id => "table", call => \&preprocess);
} # }}}
sub getsetup () { #{{{
return
plugin => {
safe => 1,
rebuild => undef,
},
} #}}}
sub preprocess (@) { #{{{
my %params =(
format => 'auto',

View File

@ -25,6 +25,10 @@ sub getopt () { #{{{
sub getsetup () { #{{{
return
plugin => {
safe => 1,
rebuild => undef,
},
tagbase => {
type => "string",
example => "tag",

View File

@ -9,9 +9,18 @@ use HTML::Template;
use Encode;
sub import { #{{{
hook(type => "getsetup", id => "template", call => \&getsetup);
hook(type => "preprocess", id => "template", call => \&preprocess);
} # }}}
sub getsetup () { #{{{
return
plugin => {
safe => 1,
rebuild => undef,
},
} #}}}
sub preprocess (@) { #{{{
my %params=@_;

View File

@ -6,9 +6,18 @@ use strict;
use IkiWiki 2.00;
sub import { #{{{
hook(type => "getsetup", id => "testpagespec", call => \&getsetup);
hook(type => "preprocess", id => "testpagespec", call => \&preprocess);
} # }}}
sub getsetup () { #{{{
return
plugin => {
safe => 1,
rebuild => undef,
},
} #}}}
sub preprocess (@) { #{{{
my %params=@_;

View File

@ -11,9 +11,18 @@ use HTML::Entities;
use IkiWiki 2.00;
sub import { #{{{
hook(type => "getsetup", id => "teximg", call => \&getsetup);
hook(type => "preprocess", id => "teximg", call => \&preprocess);
} #}}}
sub getsetup () { #{{{
return
plugin => {
safe => 1,
rebuild => undef,
},
} #}}}
sub preprocess (@) { #{{{
my %params = @_;

View File

@ -10,9 +10,18 @@ use IkiWiki 2.00;
use Encode;
sub import { #{{{
hook(type => "getsetup", id => "textile", call => \&getsetup);
hook(type => "htmlize", id => "txtl", call => \&htmlize);
} # }}}
sub getsetup () { #{{{
return
plugin => {
safe => 1,
rebuild => 1, # format plugin
},
} #}}}
sub htmlize (@) { #{{{
my %params=@_;
my $content = decode_utf8(encode_utf8($params{content}));

View File

@ -31,6 +31,10 @@ sub checkconfig () { #{{{
sub getsetup () { #{{{
return
plugin => {
safe => 0, # rcs plugin
rebuild => undef,
},
tla_wrapper => {
type => "string",
#example => "", # TODO example

View File

@ -8,10 +8,19 @@ use IkiWiki 2.00;
use HTML::Parser;
sub import { #{{{
hook(type => "getsetup", id => "toc", call => \&getsetup);
hook(type => "preprocess", id => "toc", call => \&preprocess);
hook(type => "format", id => "toc", call => \&format);
} # }}}
sub getsetup () { #{{{
return
plugin => {
safe => 1,
rebuild => undef,
},
} #}}}
my %tocpages;
sub preprocess (@) { #{{{

View File

@ -60,6 +60,7 @@ function getElementsByClass(cls, node, tag) {
EOF
sub import { #{{{
hook(type => "getsetup", id => "toggle", call => \&getsetup);
hook(type => "preprocess", id => "toggle",
call => \&preprocess_toggle);
hook(type => "preprocess", id => "toggleable",
@ -67,6 +68,14 @@ sub import { #{{{
hook(type => "format", id => "toggle", call => \&format);
} # }}}
sub getsetup () { #{{{
return
plugin => {
safe => 1,
rebuild => undef,
},
} #}}}
sub genid ($$) { #{{{
my $page=shift;
my $id=shift;

View File

@ -14,7 +14,8 @@ use HTML::Entities;
my $findurl=0;
sub import {
hook(type => "filter", id => "txt", call => \&filter);
hook(type => "getsetup", id => "txt", call => \&getsetup);
hook(type => "filter", id => "txt", call => \&filter);
hook(type => "htmlize", id => "txt", call => \&htmlize);
eval q{use URI::Find};
@ -23,6 +24,14 @@ sub import {
}
}
sub getsetup () { #{{{
return
plugin => {
safe => 1,
rebuild => 1, # format plugin
},
} #}}}
# We use filter to convert raw text to HTML
# (htmlize is called after other plugins insert HTML)
sub filter (@) {

View File

@ -24,6 +24,10 @@ sub getsetup () { #{{{
error($@) if $@;
return
plugin => {
safe => 1,
rebuild => 1,
},
typographyattributes => {
type => "string",
example => "3",

View File

@ -7,10 +7,19 @@ use strict;
use IkiWiki 2.00;
sub import { #{{{
hook(type => "getsetup", id => "version", call => \&getsetup);
hook(type => "needsbuild", id => "version", call => \&needsbuild);
hook(type => "preprocess", id => "version", call => \&preprocess);
} # }}}
sub getsetup () { #{{{
return
plugin => {
safe => 1,
rebuild => undef,
},
} #}}}
sub needsbuild (@) { #{{{
my $needsbuild=shift;
foreach my $page (keys %pagestate) {

View File

@ -15,6 +15,10 @@ sub import { #{{{
sub getsetup () { #{{{
return
plugin => {
safe => 1,
rebuild => 0,
},
websetup_force_plugins => {
type => "string",
example => [],

View File

@ -7,9 +7,19 @@ use strict;
use IkiWiki 2.00;
sub import { #{{{
hook(type => "getsetup", id => "wiki", call => \&getsetup);
hook(type => "htmlize", id => "wiki", call => \&htmlize);
} # }}}
sub getsetup () { #{{{
return
plugin => {
safe => 0, # format plugin
rebuild => undef,
},
} #}}}
sub htmlize (@) { #{{{
my %params=@_;
my $content = $params{content};