* Add a libdir config option to let ikiwiki load perl modules, including
plugins, from a user-configurable directory.master
parent
b4fa92f9e7
commit
1e5cd11635
|
@ -86,6 +86,7 @@ sub defaultconfig () { #{{{
|
||||||
adminemail => undef,
|
adminemail => undef,
|
||||||
plugin => [qw{mdwn inline htmlscrubber passwordauth openid signinedit
|
plugin => [qw{mdwn inline htmlscrubber passwordauth openid signinedit
|
||||||
lockedit conditional}],
|
lockedit conditional}],
|
||||||
|
libdir => undef,
|
||||||
timeformat => '%c',
|
timeformat => '%c',
|
||||||
locale => undef,
|
locale => undef,
|
||||||
sslcookie => 0,
|
sslcookie => 0,
|
||||||
|
@ -140,6 +141,10 @@ sub checkconfig () { #{{{
|
||||||
} #}}}
|
} #}}}
|
||||||
|
|
||||||
sub loadplugins () { #{{{
|
sub loadplugins () { #{{{
|
||||||
|
if (defined $config{libdir}) {
|
||||||
|
unshift @INC, $config{libdir};
|
||||||
|
}
|
||||||
|
|
||||||
loadplugin($_) foreach @{$config{plugin}};
|
loadplugin($_) foreach @{$config{plugin}};
|
||||||
|
|
||||||
run_hooks(getopt => sub { shift->() });
|
run_hooks(getopt => sub { shift->() });
|
||||||
|
|
|
@ -17,8 +17,10 @@ ikiwiki (2.5) UNRELEASED; urgency=low
|
||||||
* Add templatefile hook.
|
* Add templatefile hook.
|
||||||
* Add pagetemplate plugin, which allows changing the template used for
|
* Add pagetemplate plugin, which allows changing the template used for
|
||||||
a page. (Not to be confused with the hook of the same name..)
|
a page. (Not to be confused with the hook of the same name..)
|
||||||
|
* Add a libdir config option to let ikiwiki load perl modules, including
|
||||||
|
plugins, from a user-configurable directory.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Thu, 26 Jul 2007 16:16:55 -0400
|
-- Joey Hess <joeyh@debian.org> Thu, 26 Jul 2007 20:47:23 -0400
|
||||||
|
|
||||||
ikiwiki (2.4) unstable; urgency=low
|
ikiwiki (2.4) unstable; urgency=low
|
||||||
|
|
||||||
|
|
|
@ -109,6 +109,8 @@ use IkiWiki::Setup::Standard {
|
||||||
# htmltidy fortune sidebar map rst anonok}],
|
# htmltidy fortune sidebar map rst anonok}],
|
||||||
# If you want to disable any of the default plugins, list them here.
|
# If you want to disable any of the default plugins, list them here.
|
||||||
#disable_plugins => [qw{inline htmlscrubber passwordauth openid}],
|
#disable_plugins => [qw{inline htmlscrubber passwordauth openid}],
|
||||||
|
# To add a directory to the perl searh path, use this.
|
||||||
|
#libdir => "/home/me/.ikiwiki/",
|
||||||
|
|
||||||
# For use with the tag plugin, make all tags be located under a
|
# For use with the tag plugin, make all tags be located under a
|
||||||
# base page.
|
# base page.
|
||||||
|
|
|
@ -11,14 +11,6 @@ To enable plugins, use the `--plugin` switch described in
|
||||||
Enable the [[goodstuff]] plugin to get a nice selection of plugins that
|
Enable the [[goodstuff]] plugin to get a nice selection of plugins that
|
||||||
will fit most uses of ikiwiki.
|
will fit most uses of ikiwiki.
|
||||||
|
|
||||||
Without administrator access, you can add some custom plugins by storing
|
|
||||||
yourcustomplugin.pm in /home/user/.ikiwiki/IkiWiki/Plugins (or any other
|
|
||||||
place, keeping the "IkiWiki/Plugins" part of the path) and adding this
|
|
||||||
line at the begining of your ikiwiki.setup file:
|
|
||||||
|
|
||||||
BEGIN { push @INC, "/home/user/.ikiwiki" }
|
|
||||||
|
|
||||||
|
|
||||||
## Plugin directory
|
## Plugin directory
|
||||||
|
|
||||||
[[inline pages="plugins/* and !plugins/type/* and !plugins/write and
|
[[inline pages="plugins/* and !plugins/type/* and !plugins/write and
|
||||||
|
|
|
@ -13,3 +13,7 @@ IkiWiki::Plugin namespace, so they go in a IkiWiki/Plugin subdirectory
|
||||||
inside the perl search path. For example, if your perl looks in
|
inside the perl search path. For example, if your perl looks in
|
||||||
`/usr/local/lib/site_perl` for modules, you can locally install ikiwiki
|
`/usr/local/lib/site_perl` for modules, you can locally install ikiwiki
|
||||||
plugins to `/usr/local/lib/site_perl/IkiWiki/Plugin`
|
plugins to `/usr/local/lib/site_perl/IkiWiki/Plugin`
|
||||||
|
|
||||||
|
You can use the `libdir` configuration option to add a directory to the
|
||||||
|
search path. For example, if you set `libdir` to `/home/you/.ikiwiki/`,
|
||||||
|
then ikiwiki will look for plugins in `/home/you/.ikiwiki/IkiWiki/Plugins`.
|
||||||
|
|
|
@ -229,6 +229,12 @@ configuration options of their own.
|
||||||
Disables use of a plugin. For example "--disable-plugin htmlscrubber"
|
Disables use of a plugin. For example "--disable-plugin htmlscrubber"
|
||||||
to do away with HTML sanitization.
|
to do away with HTML sanitization.
|
||||||
|
|
||||||
|
* --libdir directory
|
||||||
|
|
||||||
|
Makes ikiwiki look in the specified directory first, before the regular perl
|
||||||
|
library directories. For example, if you set libdir to "/home/you/.ikiwiki/",
|
||||||
|
you can install plugins in "/home/you/.ikiwiki/IkiWiki/Plugins/".
|
||||||
|
|
||||||
* --discussion, --no-discussion
|
* --discussion, --no-discussion
|
||||||
|
|
||||||
Enables or disables "Discussion" links from being added to the header of
|
Enables or disables "Discussion" links from being added to the header of
|
||||||
|
|
|
@ -50,6 +50,7 @@ sub getconfig () { #{{{
|
||||||
"httpauth!" => \$config{httpauth},
|
"httpauth!" => \$config{httpauth},
|
||||||
"userdir=s" => \$config{userdir},
|
"userdir=s" => \$config{userdir},
|
||||||
"htmlext=s" => \$config{htmlext},
|
"htmlext=s" => \$config{htmlext},
|
||||||
|
"libdir" => \$config{libdir},
|
||||||
"exclude=s@" => sub {
|
"exclude=s@" => sub {
|
||||||
push @{$config{wiki_file_prune_regexps}}, $_[1];
|
push @{$config{wiki_file_prune_regexps}}, $_[1];
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue