diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-11-22 02:28:42 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-11-22 02:28:42 +0000 |
commit | a405b46c3b6020e1fa3631bfe5fd982f315c977f (patch) | |
tree | e3c073a2ac07f9fb6686d105f542bae1815a145d /IkiWiki.pm | |
parent | 538a7a487b2872a82721322dd1333c2e0381b8c7 (diff) | |
download | ikiwiki-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.pm | 19 |
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"; |