syslog => 0,
wikiname => "wiki",
default_pageext => "mdwn",
+ htmlext => "html",
cgi => 0,
post_commit => 0,
rcs => '',
adminemail => undef,
plugin => [qw{mdwn inline htmlscrubber passwordauth openid signinedit
lockedit conditional}],
+ libdir => undef,
timeformat => '%c',
locale => undef,
sslcookie => 0,
} #}}}
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"
sub htmlpage ($) { #{{{
my $page=shift;
- return targetpage($page, "html");
+ return targetpage($page, $config{htmlext});
} #}}}
sub srcfile ($) { #{{{
sub beautify_url ($) { #{{{
my $url=shift;
- $url =~ s!/index.html$!/!;
+ $url =~ s!/index.$config{htmlext}$!/!;
$url =~ s!^$!./!; # Browsers don't like empty links...
return $url;
$bestlink.="#".$opts{anchor};
}
- return "<a href=\"$bestlink\">$linktext</a>";
+ my @attrs;
+ if (defined $opts{rel}) {
+ push @attrs, ' rel="'.$opts{rel}.'"';
+ }
+
+ return "<a href=\"$bestlink\"@attrs>$linktext</a>";
} #}}}
sub htmlize ($$$) { #{{{
my $command=shift;
my $params=shift;
if (length $escape) {
- return "[[$command $params]]";
+ return "\\[[$command $params]]";
}
elsif (exists $hooks{preprocess}{$command}) {
return "" if $scan && ! $hooks{preprocess}{$command}{scan};
return "";
}
- require HTML::Template;
my @ret=(
filter => sub {
my $text_ref = shift;
} #}}}
sub template ($;@) { #{{{
+ require HTML::Template;
HTML::Template->new(template_params(@_));
} #}}}