]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* Introduce add_plugins and disable_plugins config options in setup files.
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Mon, 3 Jul 2006 21:29:56 +0000 (21:29 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Mon, 3 Jul 2006 21:29:56 +0000 (21:29 +0000)
  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.

IkiWiki/Render.pm
IkiWiki/Setup/Standard.pm
debian/NEWS
debian/changelog
doc/ikiwiki.setup
doc/plugins.mdwn
ikiwiki

index 960d1da1e7fbd7c4c64fea6cb24082d1b41521e5..ac8f0393743a4c1889d55a9557896a2baa8b7d74 100644 (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");
        }
 } #}}}
 
index 786ba70ace16abfaaa02498e3afb7e39a74f321a..d42ceffa08d0767743d5036ab9b6948a2ffd19da 100644 (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}};
index 177fbc9ad2023de5e6b65e4cbecddb4cb0e12e18..858894e052a8e4f3712ec404475ae5dff69b62c3 100644 (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:
index eefa9e19c69ce88d054c5c29818c4a8dab222489..082ab418f76a3b44ec78115f4b104a9bf7f122d4 100644 (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
 
index f8d37ca21bc29c3e9a3d6372097519b2a529baa5..c516da1b90c5f996325f4c0081d8cadad88a3b99 100644 (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}],
 }
index 2c184900c5f3fc9a71adde8718ff972d71046c06..05b661f2b916834508713654eb0d86a86668401f 100644 (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
 
diff --git a/ikiwiki b/ikiwiki
index f32eb4879494861815af296e979377573a1e3d0c..099a821b7ad9fe7afebf53634edb34f49ab85671 100755 (executable)
--- a/ikiwiki
+++ b/ikiwiki
@@ -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];