aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki.pm
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-11-22 02:28:42 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-11-22 02:28:42 +0000
commita405b46c3b6020e1fa3631bfe5fd982f315c977f (patch)
treee3c073a2ac07f9fb6686d105f542bae1815a145d /IkiWiki.pm
parent538a7a487b2872a82721322dd1333c2e0381b8c7 (diff)
downloadikiwiki-a405b46c3b6020e1fa3631bfe5fd982f315c977f.tar
ikiwiki-a405b46c3b6020e1fa3631bfe5fd982f315c977f.tar.gz
* Add toggle plugin.
* Introduce the nicebundle. This is a kind of plugin, that just enables many other plugins. It's an easy way to boost ikiwiki from its default, basic wiki, to a full-featured wiki, without manually picking the right set of plugins. New plugins will be added to the nicebundle from time to time.
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r--IkiWiki.pm19
1 files changed, 12 insertions, 7 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 703b596a8..5f7bdfd06 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -116,13 +116,8 @@ sub checkconfig () { #{{{
} #}}}
sub loadplugins () { #{{{
- foreach my $plugin (@{$config{plugin}}) {
- my $mod="IkiWiki::Plugin::".possibly_foolish_untaint($plugin);
- eval qq{use $mod};
- if ($@) {
- error("Failed to load plugin $mod: $@");
- }
- }
+ loadplugin($_) foreach @{$config{plugin}};
+
run_hooks(getopt => sub { shift->() });
if (grep /^-/, @ARGV) {
print STDERR "Unknown option: $_\n"
@@ -131,6 +126,16 @@ sub loadplugins () { #{{{
}
} #}}}
+sub loadplugin ($) { #{{{
+ my $plugin=shift;
+
+ my $mod="IkiWiki::Plugin::".possibly_foolish_untaint($plugin);
+ eval qq{use $mod};
+ if ($@) {
+ error("Failed to load plugin $mod: $@");
+ }
+} #}}}
+
sub error ($) { #{{{
if ($config{cgi}) {
print "Content-type: text/html\n\n";