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)",
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 ($$;$) { #{{{
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.
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;
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;
sub getsetup () { #{{{
return
+ plugin => {
+ safe => 1,
+ rebuild => undef,
+ },
skeleton => {
type => "boolean",
example => 0,
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) {
);
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=@_;
sub getsetup () { #{{{
return
+ plugin => {
+ safe => 0, # rcs plugin
+ rebuild => undef,
+ },
svnrepo => {
type => "string",
example => "/svn/wiki",
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',
sub getsetup () { #{{{
return
+ plugin => {
+ safe => 1,
+ rebuild => undef,
+ },
tagbase => {
type => "string",
example => "tag",
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=@_;
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=@_;
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 = @_;
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}));
sub getsetup () { #{{{
return
+ plugin => {
+ safe => 0, # rcs plugin
+ rebuild => undef,
+ },
tla_wrapper => {
type => "string",
#example => "", # TODO example
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 (@) { #{{{
EOF
sub import { #{{{
+ hook(type => "getsetup", id => "toggle", call => \&getsetup);
hook(type => "preprocess", id => "toggle",
call => \&preprocess_toggle);
hook(type => "preprocess", id => "toggleable",
hook(type => "format", id => "toggle", call => \&format);
} # }}}
+sub getsetup () { #{{{
+ return
+ plugin => {
+ safe => 1,
+ rebuild => undef,
+ },
+} #}}}
+
sub genid ($$) { #{{{
my $page=shift;
my $id=shift;
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};
}
}
+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 (@) {
error($@) if $@;
return
+ plugin => {
+ safe => 1,
+ rebuild => 1,
+ },
typographyattributes => {
type => "string",
example => "3",
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) {
sub getsetup () { #{{{
return
+ plugin => {
+ safe => 1,
+ rebuild => 0,
+ },
websetup_force_plugins => {
type => "string",
example => [],
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};