]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
wrappers option is not needed, obsolete
[ikiwiki.git] / IkiWiki.pm
index 5724518dae74e9d8418dc0a235b51388d3b05433..0746ef24ba36c00b6b7d3b340440f611609f622e 100644 (file)
@@ -82,11 +82,26 @@ sub getsetup () { #{{{
        cgiurl => {
                type => "string",
                default => '',
-               examples => "http://example.com/wiki/ikiwiki.cgi",
+               example => "http://example.com/wiki/ikiwiki.cgi",
                description => "url to the ikiwiki.cgi",
                safe => 1,
                rebuild => 1,
        },
+       cgi_wrapper => {
+               type => "string",
+               default => '',
+               example => "/var/www/wiki/ikiwiki.cgi",
+               description => "cgi executable to generate",
+               safe => 0, # file
+               rebuild => 0,
+       },
+       cgi_wrappermode => {
+               type => "string",
+               default => '06755',
+               description => "mode for cgi_wrapper (can safely be made suid)",
+               safe => 0,
+               rebuild => 0,
+       },
        rcs => {
                type => "string",
                default => '',
@@ -94,33 +109,28 @@ sub getsetup () { #{{{
                safe => 0, # don't allow overriding
                rebuild => 0,
        },
-       discussion => {
-               type => "boolean",
-               default => 1,
-               description => "enable Discussion pages?",
+       default_plugins => {
+               type => "internal",
+               default => [qw{mdwn link inline htmlscrubber passwordauth
+                               openid signinedit lockedit conditional
+                               recentchanges parentlinks}],
+               description => "plugins to enable by default",
                safe => 1,
                rebuild => 1,
        },
-       wrappers => {
+       add_plugins => {
                type => "string",
-               default => undef,
-               description => "definitions of wrappers to generate",
-               safe => 0,
-               rebuild => 0,
-       },
-       wrapper => {
-               type => "internal",
-               default => undef,
-               description => "wrapper filename",
-               safe => 0,
-               rebuild => 0,
+               default => [],
+               description => "plugins to add to the default configuration",
+               safe => 1,
+               rebuild => 1,
        },
-       wrappermode => {
-               type => "internal",
-               default => undef,
-               description => "mode of wrapper file",
-               safe => 0,
-               rebuild => 0,
+       disable_plugins => {
+               type => "string",
+               default => [],
+               description => "plugins to disable",
+               safe => 1,
+               rebuild => 1,
        },
        templatedir => {
                type => "string",
@@ -136,6 +146,13 @@ sub getsetup () { #{{{
                safe => 0, # path
                rebuild => 0,
        },
+       wrappers => {
+               type => "internal",
+               default => [],
+               description => "wrappers to generate",
+               safe => 0,
+               rebuild => 0,
+       },
        underlaydirs => {
                type => "internal",
                default => [],
@@ -171,6 +188,13 @@ sub getsetup () { #{{{
                safe => 0, # changing requires manual transition
                rebuild => 1,
        },
+       discussion => {
+               type => "boolean",
+               default => 1,
+               description => "enable Discussion pages?",
+               safe => 1,
+               rebuild => 1,
+       },
        default_pageext => {
                type => "string",
                default => "mdwn",
@@ -229,7 +253,29 @@ sub getsetup () { #{{{
                safe => 0, # paranoia
                rebuild => 0,
        },
-
+       umask => {
+               type => "integer",
+               description => "",
+               example => "022",
+               description => "force ikiwiki to use a particular umask",
+               safe => 0, # paranoia
+               rebuild => 0,
+       },
+       libdir => {
+               type => "string",
+               default => "",
+               example => "$ENV{HOME}/.ikiwiki/",
+               description => "extra library and plugin directory",
+               safe => 0, # directory
+               rebuild => 0,
+       },
+       ENV => {
+               type => "string", 
+               default => {},
+               description => "environment variables",
+               safe => 0, # paranoia
+               rebuild => 0,
+       },
        exclude => {
                type => "string",
                default => undef,
@@ -319,37 +365,6 @@ sub getsetup () { #{{{
                safe => 0,
                rebuild => 0,
        },
-       default_plugins => {
-               type => "internal",
-               default => [qw{mdwn link inline htmlscrubber passwordauth
-                               openid signinedit lockedit conditional
-                               recentchanges parentlinks}],
-               description => "plugins to enable by default",
-               safe => 1,
-               rebuild => 1,
-       },
-       add_plugins => {
-               type => "string",
-               default => [],
-               description => "plugins to add to the default configuration",
-               safe => 1,
-               rebuild => 1,
-       },
-       disable_plugins => {
-               type => "string",
-               default => [],
-               description => "plugins to disable",
-               safe => 1,
-               rebuild => 1,
-       },
-       libdir => {
-               type => "internal",
-               default => undef,
-               example => "$ENV{HOME}/.ikiwiki/",
-               description => "extra library and plugin directory",
-               safe => 0,
-               rebuild => 0,
-       },
 } #}}}
 
 sub defaultconfig () { #{{{
@@ -399,16 +414,13 @@ sub checkconfig () { #{{{
                unless exists $config{wikistatedir};
        
        if ($config{rcs}) {
-               eval qq{use IkiWiki::Rcs::$config{rcs}};
-               if ($@) {
-                       error("Failed to load RCS module IkiWiki::Rcs::$config{rcs}: $@");
-               }
+               loadplugin($config{rcs});
        }
        else {
-               require IkiWiki::Rcs::Stub;
+               loadplugin("norcs");
        }
 
-       if (exists $config{umask}) {
+       if (defined $config{umask}) {
                umask(possibly_foolish_untaint($config{umask}));
        }
 
@@ -417,6 +429,26 @@ sub checkconfig () { #{{{
        return 1;
 } #}}}
 
+sub listplugins () { #{{{
+       my %ret;
+
+       foreach my $dir (@INC, $config{libdir}) {
+               next unless defined $dir;
+               foreach my $file (glob("$dir/IkiWiki/Plugin/*.pm")) {
+                       my ($plugin)=$file=~/.*\/(.*)\.pm$/;
+                       $ret{$plugin}=1;
+               }
+       }
+       foreach my $dir ($config{libdir}, "$installdir/lib/ikiwiki") {
+               next unless defined $dir;
+               foreach my $file (glob("$dir/plugins/*")) {
+                       $ret{basename($file)}=1 if -x $file;
+               }
+       }
+
+       return keys %ret;
+} #}}}
+
 sub loadplugins () { #{{{
        if (defined $config{libdir}) {
                unshift @INC, possibly_foolish_untaint($config{libdir});
@@ -1033,13 +1065,10 @@ sub preprocess ($$$;$$) { #{{{
                        if ($preprocessing{$page}++ > 3) {
                                # Avoid loops of preprocessed pages preprocessing
                                # other pages that preprocess them, etc.
-                               #translators: The first parameter is a
-                               #translators: preprocessor directive name,
-                               #translators: the second a page name, the
-                               #translators: third a number.
-                               return "[[".sprintf(gettext("%s preprocessing loop detected on %s at depth %i"),
-                                       $command, $page, $preprocessing{$page}).
-                               "]]";
+                               return "[[!$command <span class=\"error\">".
+                                       sprintf(gettext("preprocessing loop detected on %s at depth %i"),
+                                               $page, $preprocessing{$page}).
+                                       "</span>]]";
                        }
                        my $ret;
                        if (! $scan) {
@@ -1396,6 +1425,46 @@ sub run_hooks ($$) { # {{{
        return 1;
 } #}}}
 
+sub rcs_update () { #{{{
+       $hooks{rcs}{rcs_update}{call}->(@_);
+} #}}}
+
+sub rcs_prepedit ($) { #{{{
+       $hooks{rcs}{rcs_prepedit}{call}->(@_);
+} #}}}
+
+sub rcs_commit ($$$;$$) { #{{{
+       $hooks{rcs}{rcs_commit}{call}->(@_);
+} #}}}
+
+sub rcs_commit_staged ($$$) { #{{{
+       $hooks{rcs}{rcs_commit_staged}{call}->(@_);
+} #}}}
+
+sub rcs_add ($) { #{{{
+       $hooks{rcs}{rcs_add}{call}->(@_);
+} #}}}
+
+sub rcs_remove ($) { #{{{
+       $hooks{rcs}{rcs_remove}{call}->(@_);
+} #}}}
+
+sub rcs_rename ($$) { #{{{
+       $hooks{rcs}{rcs_rename}{call}->(@_);
+} #}}}
+
+sub rcs_recentchanges ($) { #{{{
+       $hooks{rcs}{rcs_recentchanges}{call}->(@_);
+} #}}}
+
+sub rcs_diff ($) { #{{{
+       $hooks{rcs}{rcs_diff}{call}->(@_);
+} #}}}
+
+sub rcs_getctime ($) { #{{{
+       $hooks{rcs}{rcs_getctime}{call}->(@_);
+} #}}}
+
 sub globlist_to_pagespec ($) { #{{{
        my @globlist=split(' ', shift);