X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/1612dce6bbb050eacf6843b972ffaf9816d724be..30f7aef67902cbb04d35854e01be21c29ba2de0d:/IkiWiki.pm
diff --git a/IkiWiki.pm b/IkiWiki.pm
index e5d1c5c44..7c35ce2b5 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -86,6 +86,7 @@ sub defaultconfig () { #{{{
adminemail => undef,
plugin => [qw{mdwn inline htmlscrubber passwordauth openid signinedit
lockedit conditional}],
+ libdir => undef,
timeformat => '%c',
locale => undef,
sslcookie => 0,
@@ -140,8 +141,12 @@ sub checkconfig () { #{{{
} #}}}
sub loadplugins () { #{{{
+ if (defined $config{libdir}) {
+ unshift @INC, $config{libdir};
+ }
+
loadplugin($_) foreach @{$config{plugin}};
-
+
run_hooks(getopt => sub { shift->() });
if (grep /^-/, @ARGV) {
print STDERR "Unknown option: $_\n"
@@ -155,11 +160,20 @@ sub loadplugin ($) { #{{{
return if grep { $_ eq $plugin} @{$config{disable_plugins}};
+ foreach my $dir ($config{libdir}, "$installdir/lib/ikiwiki") {
+ if (defined $dir && -x "$dir/plugins/$plugin") {
+ require IkiWiki::Plugin::external;
+ import IkiWiki::Plugin::external "$dir/plugins/$plugin";
+ return 1;
+ }
+ }
+
my $mod="IkiWiki::Plugin::".possibly_foolish_untaint($plugin);
eval qq{use $mod};
if ($@) {
error("Failed to load plugin $mod: $@");
}
+ return 1;
} #}}}
sub error ($;$) { #{{{
@@ -541,7 +555,12 @@ sub htmllink ($$$;@) { #{{{
$bestlink.="#".$opts{anchor};
}
- return "$linktext";
+ my @attrs;
+ if (defined $opts{rel}) {
+ push @attrs, ' rel="'.$opts{rel}.'"';
+ }
+
+ return "$linktext";
} #}}}
sub htmlize ($$$) { #{{{
@@ -1031,7 +1050,7 @@ sub pagespec_translate ($) { #{{{
|
\) # )
|
- \w+\([^\)]+\) # command(params)
+ \w+\([^\)]*\) # command(params)
|
[^\s()]+ # any other text
)