]> sipb.mit.edu Git - ikiwiki.git/commitdiff
Group related plugins into sections in the setup file, and drop unused rcs plugins...
authorJoey Hess <joey@gnu.kitenet.net>
Fri, 12 Feb 2010 03:24:15 +0000 (22:24 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Fri, 12 Feb 2010 03:24:15 +0000 (22:24 -0500)
30 files changed:
IkiWiki/Plugin/anonok.pm
IkiWiki/Plugin/blogspam.pm
IkiWiki/Plugin/bzr.pm
IkiWiki/Plugin/conditional.pm
IkiWiki/Plugin/cvs.pm
IkiWiki/Plugin/darcs.pm
IkiWiki/Plugin/editpage.pm
IkiWiki/Plugin/git.pm
IkiWiki/Plugin/htmlscrubber.pm
IkiWiki/Plugin/httpauth.pm
IkiWiki/Plugin/inline.pm
IkiWiki/Plugin/link.pm
IkiWiki/Plugin/lockedit.pm
IkiWiki/Plugin/mdwn.pm
IkiWiki/Plugin/mercurial.pm
IkiWiki/Plugin/meta.pm
IkiWiki/Plugin/moderatedcomments.pm
IkiWiki/Plugin/monotone.pm
IkiWiki/Plugin/opendiscussion.pm
IkiWiki/Plugin/openid.pm
IkiWiki/Plugin/parentlinks.pm
IkiWiki/Plugin/passwordauth.pm
IkiWiki/Plugin/recentchanges.pm
IkiWiki/Plugin/signinedit.pm
IkiWiki/Plugin/svn.pm
IkiWiki/Plugin/tla.pm
IkiWiki/Setup.pm
IkiWiki/Setup/Standard.pm
debian/changelog
doc/plugins/write.mdwn

index 243b9892056028ea3cd289257c70274a54a410f6..0e74cbfadfbe71986ae2755b98d979cd3d00cb9b 100644 (file)
@@ -15,6 +15,7 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => 0,
+                       section => "auth",
                },
                anonok_pagespec => {
                        type => "pagespec",
index 626c8ec42acc8f69297d416ef358e66702a153b3..c4e5cf390cb397a994414bf718c135b4bf498c22 100644 (file)
@@ -18,6 +18,7 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => 0,
+                       section => "auth",
                },
                blogspam_pagespec => {
                        type => 'pagespec',
index 8830073672663b77d2e21fb837a15a913b7b6c0d..1ffdc23535d81578b9fab129953659028a6ec96e 100644 (file)
@@ -36,6 +36,7 @@ sub getsetup () {
                plugin => {
                        safe => 0, # rcs plugin
                        rebuild => undef,
+                       section => "rcs",
                },
                bzr_wrapper => {
                        type => "string",
index aad617812fc69229aa9ffa6979570d078f090023..beeddc67273156216488c3aab8ca84f5e4e56b6c 100644 (file)
@@ -16,6 +16,7 @@ sub getsetup {
                plugin => {
                        safe => 1,
                        rebuild => undef,
+                       section => "core",
                },
 }
 
index f6db8bc98b0f723feb40363eb7978ffc469c9ab9..26a3e9dd291edf8e74c1aa6fdfbb91617f4bfd2d 100644 (file)
@@ -85,6 +85,7 @@ sub getsetup () {
                plugin => {
                        safe => 0, # rcs plugin
                        rebuild => undef,
+                       section => "rcs",
                },
                cvsrepo => {
                        type => "string",
index 0d68f27e5874b3331cbab851b1dafdfa06d21673..1c9538e83efb490a637b21bf2da818ddbe682bd6 100644 (file)
@@ -92,6 +92,7 @@ sub getsetup() {
                plugin => {
                        safe => 0, # rcs plugin
                        rebuild => undef,
+                       section => "rcs",
                },
                darcs_wrapper => {
                        type => "string",
index 9211cca8939efc962a8e8431958bc2e54d16aef7..44fe5514a7cf0017ce3a3f5c1193ed78c2af1108 100644 (file)
@@ -17,6 +17,7 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => 1,
+                       section => "core",
                },
 }
 
index 1eec6aee61eaf2c28e0e2187236dcec02db95ca9..b02f4a5ed5750145fe711095c3f7afa085c38732 100644 (file)
@@ -68,6 +68,7 @@ sub getsetup () {
                plugin => {
                        safe => 0, # rcs plugin
                        rebuild => undef,
+                       section => "rcs",
                },
                git_wrapper => {
                        type => "string",
index a249cdf7a43b2986b5ca519f88c01cc6fcf85141..ee284a45c3e46815f47a9001e1badb45adacdb6c 100644 (file)
@@ -40,6 +40,7 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => undef,
+                       section => "core",
                },
                htmlscrubber_skip => {
                        type => "pagespec",
index b2bb2701a3f7bb65054b5432faaf0f36cee9dfe1..478f6744656f5bdbd4baa00f79cadb9a74ebd255 100644 (file)
@@ -20,6 +20,7 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => 0,
+                       section => "auth",
                },
                cgiauthurl => {
                        type => "string",
index 401852513d1fbe8d14fe4ebfbf38cadd781c410d..44919e58c35d658535fbb6e8e2e6f745e3c69311 100644 (file)
@@ -49,6 +49,7 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => undef,
+                       section => "core",
                },
                rss => {
                        type => "boolean",
index 4c1add9853a3b4053f34b8d927e52ea0e7e4d1f4..3838aec09708450d8d3f9ba338b3cb3b09ee6892 100644 (file)
@@ -20,6 +20,7 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => 1,
+                       section => "core",
                },
 }
 
index 74ddbb1537929189206f675fdb49bfbf9247837c..1466e8337f5f16c74c6f809f7af7a62bfadfb56e 100644 (file)
@@ -15,6 +15,7 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => 0,
+                       section => "auth",
                },
                locked_pages => {
                        type => "pagespec",
index 3de59ef3d036d56f7fa4876f8a1020ad59d994aa..4ddf097ba669f8327eef8c635a7cfc353896d083 100644 (file)
@@ -16,6 +16,7 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => 1, # format plugin
+                       section => "core",
                },
                multimarkdown => {
                        type => "boolean",
index 11fdec529373c6b430a8e77bebb2c0a3aa6972b7..ea00a33648431daadb94efa398e47c3c224a6f89 100644 (file)
@@ -36,6 +36,7 @@ sub getsetup () {
                plugin => {
                        safe => 0, # rcs plugin
                        rebuild => undef,
+                       section => "rcs",
                },
                mercurial_wrapper => {
                        type => "string",
index 55c9ddbd1482f8d47007c4e1b66cf2ea6d2f2332..5f046cb2a06e90fdc53939ae2d2b3490d2d4d30e 100644 (file)
@@ -20,6 +20,7 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => undef,
+                       section => "core",
                },
 }
 
index 2555927b7992fb8e042a9f145ce1a82cded5fcb4..afe1ceedf0940cf3ebe94e7de56b5faf0f1c720f 100644 (file)
@@ -15,6 +15,7 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => 0,
+                       section => "auth",
                },
                moderate_users => {
                        type => 'boolean',
index 9502804f19637e1ec905b88758091f93d2c0953c..c33cf7e3a0dad0c0f052400c00da2b928f8fd289 100644 (file)
@@ -68,6 +68,7 @@ sub getsetup () {
                plugin => {
                        safe => 0, # rcs plugin
                        rebuild => undef,
+                       section => "rcs",
                },
                mtn_wrapper => {
                        type => "string",
index 5a455940b8b9fc286aec4816973d09f39f0510b7..2805f60efdb6d415a19aeb17195df8ff2543487b 100644 (file)
@@ -16,6 +16,7 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => 0,
+                       section => "auth",
                },
 }
 
index 382d8286f73bd371010810e6b295aab5946a68e0..bb99446b4db2138f82dcce277caa097bff9e5ca1 100644 (file)
@@ -26,6 +26,7 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => 0,
+                       section => "auth",
                },
                openidsignup => {
                        type => "string",
index e678a057d2bdf9a03aa741f8bd019f39e8667bca..728bbc399fe8b50e247318158a57bd5c2facad96 100644 (file)
@@ -16,6 +16,7 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => 1,
+                       section => "core",
                },
 }
 
index c07065b7dca7b3f476f2e1a7add35bf0423855ca..4848b47bbac53726aeefde96d41beb21e9949d45 100644 (file)
@@ -19,6 +19,7 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => 0,
+                       section => "auth",
                },
                account_creation_password => {
                        type => "string",
index 5c7b71aaa64bd02e310b6c5428224ce68ba0679a..04219b72146a18c74cb5a637ddda2675deb91430 100644 (file)
@@ -22,6 +22,7 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => 1,
+                       section => "core",
                },
                recentchangespage => {
                        type => "string",
index 8b44a68f725230118d7fe71619793a1bac3199b2..31160c02ffb581ad28da533e42737db8761295fe 100644 (file)
@@ -16,6 +16,7 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => 0,
+                       section => "auth",
                },
 }
 
index 06b987f51ce756676aa977c2c95af0aa4628e952..7d27ec8427b1b341c1dc7e9d3d3b92f2a4e838a1 100644 (file)
@@ -44,6 +44,7 @@ sub getsetup () {
                plugin => {
                        safe => 0, # rcs plugin
                        rebuild => undef,
+                       section => "rcs",
                },
                svnrepo => {
                        type => "string",
index f4b20a6ec2b27681b98b92fa4d787cb9d8cb1fe1..16d73b1362fa75ad2be342942136c76f475f4e4c 100644 (file)
@@ -34,6 +34,7 @@ sub getsetup () {
                plugin => {
                        safe => 0, # rcs plugin
                        rebuild => undef,
+                       section => "rcs",
                },
                tla_wrapper => {
                        type => "string",
index 8a25ecc575da894711d27e4583e6ab491b350a45..b21bd7bfe549929b29283226a14b1234c08ec595 100644 (file)
@@ -77,7 +77,6 @@ sub merge ($) {
 sub getsetup () {
        # Gets all available setup data from all plugins. Returns an
        # ordered list of [plugin, setup] pairs.
-       my @ret;
 
         # disable logging to syslog while dumping, broken plugins may
        # whine when loaded
@@ -85,27 +84,48 @@ sub getsetup () {
         $config{syslog}=undef;
 
        # Load all plugins, so that all setup options are available.
-       my @plugins=grep { $_ ne $config{rcs} } sort(IkiWiki::listplugins());
-       unshift @plugins, $config{rcs} if $config{rcs}; # rcs plugin 1st
+       my @plugins=IkiWiki::listplugins();
        foreach my $plugin (@plugins) {
                eval { IkiWiki::loadplugin($plugin) };
                if (exists $IkiWiki::hooks{checkconfig}{$plugin}{call}) {
                        my @s=eval { $IkiWiki::hooks{checkconfig}{$plugin}{call}->() };
                }
        }
-
+       
+       my %sections;
        foreach my $plugin (@plugins) {
                if (exists $IkiWiki::hooks{getsetup}{$plugin}{call}) {
                        # use an array rather than a hash, to preserve order
                        my @s=eval { $IkiWiki::hooks{getsetup}{$plugin}{call}->() };
                        next unless @s;
-                       push @ret, [ $plugin, \@s ],
+
+                       # set default section value (note use of shared
+                       # hashref between array and hash)
+                       my %s=@s;
+                       if (! exists $s{plugin} || ! $s{plugin}->{section}) {
+                               $s{plugin}->{section}="misc";
+                       }
+
+                       # only the selected rcs plugin is included
+                       if ($config{rcs} && $plugin eq $config{rcs}) {
+                               $s{plugin}->{section}="core";
+                       }
+                       elsif ($s{plugin}->{section} eq "rcs") {
+                               next;
+                       }
+
+                       push @{$sections{$s{plugin}->{section}}}, [ $plugin, \@s ];
                }
        }
        
         $config{syslog}=$syslog;
 
-       return @ret;
+       return map { sort { $a->[0] cmp $b->[0] } @{$sections{$_}} }
+               sort { # core first, then alphabetical
+                       ($b eq "core") <=> ($a eq "core")
+                          ||
+                       $a cmp $b
+               } keys %sections;
 }
 
 sub dump ($) {
index 951bcfc56febfce724d82c652f96468c227709d2..c99dbb620d9473cca44bbec527c115d47a5574d5 100644 (file)
@@ -90,10 +90,18 @@ sub gendump ($) {
        # disable logging to syslog while dumping
        $config{syslog}=undef;
 
+       my $curr_section;
        push @ret, dumpvalues(\%setup, IkiWiki::getsetup());
        foreach my $pair (IkiWiki::Setup::getsetup()) {
                my $plugin=$pair->[0];
                my $setup=$pair->[1];
+               my %s=@{$setup};
+               my $section=$s{plugin}->{section};
+               if (! defined $curr_section || $curr_section ne $section) {
+                       $curr_section=$section;
+                       push @ret, "", "\t#", "\t# $section plugins", "\t#";
+               }
+
                my @values=dumpvalues(\%setup, @{$setup});
                if (@values) {
                        push @ret, "", "\t# $plugin plugin", @values;
index d74abd0f98996c436d202bd46eca3446e51de2c1..f24a453c8379132bb40dcd0144da234d0acbac75 100644 (file)
@@ -22,6 +22,8 @@ ikiwiki (3.20100123) UNRELEASED; urgency=low
   * httpauth: Add httpauth_pagespec setting that can be used to limit
     pages to only being edited via users authed with httpauth.
   * Allow globs to be used in user() pagespecs.
+  * Group related plugins into sections in the setup file, and drop
+    unused rcs plugins from the setup file.
 
  -- Joey Hess <joeyh@debian.org>  Tue, 26 Jan 2010 22:25:33 -0500
 
index 082f0e38f589d50d2fd14b5f6637d1ddf6b91869..68454d56c70ffd75970f4b70fb2942a389008cc0 100644 (file)
@@ -457,6 +457,12 @@ describing the option. There can also be an item named "plugin", which
 describes the plugin as a whole. For example:
 
                 return
+                       plugin => {
+                               description => "description of this plugin",
+                               safe => 1,
+                               rebuild => 1,
+                               section => "misc",
+                       },
                        option_foo => {
                                type => "boolean",
                                description => "enable foo?",
@@ -471,11 +477,6 @@ describes the plugin as a whole. For example:
                                safe => 1,
                                rebuild => 0,
                        },
-                       plugin => {
-                               description => "description of this plugin",
-                               safe => 1,
-                               rebuild => 1,
-                       },
 
 * `type` can be "boolean", "string", "integer", "pagespec",
   or "internal" (used for values that are not user-visible). The type is
@@ -496,6 +497,8 @@ describes the plugin as a whole. For example:
   the plugin) will require a wiki rebuild, false if no rebuild is needed,
   and undef if a rebuild could be needed in some circumstances, but is not
   strictly required.
+* `section` can optionally specify which section in the config file
+  the plugin fits in.
 
 ### genwrapper