* Introduce add_plugins and disable_plugins config options in setup files.

This allows adding or removing plugins w/o overriding the whole list of
  default plugins, which makes it easier to upgrade when new default plugins
  are added.
master
joey 2006-07-03 21:29:56 +00:00
parent 929b9de9c2
commit 7ea8df24b3
7 changed files with 46 additions and 12 deletions

View File

@ -226,10 +226,7 @@ sub check_overwrite ($$) { #{{{
my $src=shift;
if (! exists $renderedfiles{$src} && -e $dest && ! $config{rebuild}) {
error("$dest already exists and was rendered from ".
join(" ",(grep { $renderedfiles{$_} eq $dest } keys
%renderedfiles)).
", before, so not rendering from $src");
error("$dest already exists and was not rendered from $src before");
}
} #}}}

View File

@ -19,6 +19,18 @@ package IkiWiki;
sub setup_standard {
my %setup=%{$_[1]};
$setup{plugin}=$config{plugin};
if (exists $setup{add_plugins}) {
push @{$setup{plugin}}, @{$setup{add_plugins}};
delete $setup{add_plugins};
}
if (exists $setup{disable_plugins}) {
foreach my $plugin (@{$setup{disable_plugins}}) {
$setup{plugin}=[grep { $_ ne $plugin } @{$setup{plugin}}];
}
delete $setup{disable_plugins};
}
if (! $config{refresh}) {
debug("generating wrappers..");
my @wrappers=@{$setup{wrappers}};

19
debian/NEWS vendored
View File

@ -1,3 +1,22 @@
ikiwiki (1.8) unstable; urgency=low
If your wiki is configured with a setup file, you should modify it to
stop setting the "plugin" list directly, and instead add or remove plugins
via the add_plugins and disable_plugins lines. For example, if you had:
plugin => [qw{inline smiley search}],
Change it to these lines, which disables the default htmlscrubber plugin
and adds the two additional plugins:
add_plugins => [qw{smiley search}],
disable_plugins => [qw{htmlscrubber}],
Making this change makes your ikiwiki setup file more future-proof since
new default plugins will be automatically used.
-- Joey Hess <joeyh@debian.org> Mon, 3 Jul 2006 16:59:29 -0400
ikiwiki (1.1) unstable; urgency=low
There have been several configuration changes in this release of ikiwiki:

6
debian/changelog vendored
View File

@ -23,8 +23,12 @@ ikiwiki (1.8) UNRELEASED; urgency=low
* Centralised all calls to HTML::Template and force all the templates
to be read as utf8.
* Support pages with utf8 filenames. Patch by Faidon Liambotis.
* Introduce add_plugins and disable_plugins config options in setup files.
This allows adding or removing plugins w/o overriding the whole list of
default plugins, which makes it easier to upgrade when new default plugins
are added.
-- Joey Hess <joeyh@debian.org> Mon, 3 Jul 2006 16:17:20 -0400
-- Joey Hess <joeyh@debian.org> Mon, 3 Jul 2006 16:57:37 -0400
ikiwiki (1.7) unstable; urgency=low

View File

@ -1,7 +1,7 @@
#!/usr/bin/perl
# Configuration file for ikiwiki.
# Passing this to ikiwiki --setup will make ikiwiki generate two
# wrapper programs, one for cgi and one for a subversion post-commit hook.
# Passing this to ikiwiki --setup will make ikiwiki generate wrappers and
# build the wiki.
#
# Remember to re-run ikiwiki --setup any time you edit this file.
@ -69,7 +69,9 @@ use IkiWiki::Setup::Standard {
discussion => 1,
# Time format (for strftime)
#timeformat => '%c',
# To change the enabled plugins, edit this list
#plugin => [qw{pagecount inline brokenlinks search smiley
# htmlscrubber}],
# To add plugins, list them here.
#add_plugins => [qw{pagecount brokenlinks search smiley}],
# If you want to disable any of the default plugins, list them here.
#disable_plugins => [qw{inline htmlscrubber}],
}

View File

@ -4,7 +4,7 @@ install and use plugins contributed by others.
The [[inline]] and [[htmlscrubber]] plugins are enabled by default.
To enable other plugins, use the `--plugin` switch described in [[usage]],
or the equivalent line in [[ikiwiki.setup]].
or the equivalent `add_plugins` line in [[ikiwiki.setup]].
# Plugin directory

View File

@ -57,7 +57,7 @@ sub getconfig () { #{{{
push @{$config{plugin}}, $_[1];
},
"disable-plugin=s@" => sub {
$config{plugin}=[grep { $_ ne $_[1] } @{$config{plugin}} ];
$config{plugin}=[grep { $_ ne $_[1] } @{$config{plugin}}];
},
"pingurl" => sub {
push @{$config{pingurl}}, $_[1];