if (! exists $ENV{WRAPPED_OPTIONS}) {
%config=(
wiki_file_prune_regexp => qr{((^|/).svn/|\.\.|^\.|\/\.|\.html?$)},
- wiki_link_regexp => qr/\[\[([^\s\]]+)\]\]/,
+ wiki_link_regexp => qr/\[\[(?:([^\s\]\|]+)\|)?([^\s\]]+)\]\]/,
wiki_processor_regexp => qr/\[\[(\w+)\s+([^\]]+)\]\]/,
- wiki_file_regexp => qr/(^[-A-Za-z0-9_.\&;:\/+]+$)/,
+ wiki_file_regexp => qr/(^[-A-Za-z0-9_.:\/+]+$)/,
verbose => 0,
wikiname => "wiki",
default_pageext => ".mdwn",
anonok => 0,
rss => 0,
rebuild => 0,
+ refresh => 0,
+ getctime => 0,
wrapper => undef,
wrappermode => undef,
srcdir => undef,
"wikiname=s" => \$config{wikiname},
"verbose|v!" => \$config{verbose},
"rebuild!" => \$config{rebuild},
+ "refresh!" => \$config{refresh},
+ "getctime" => \$config{getctime},
"wrappermode=i" => \$config{wrappermode},
"svn!" => \$config{svn},
"anonok!" => \$config{anonok},
sub isinlinableimage ($) { #{{{
my $file=shift;
- $file=~/\.(png|gif|jpg|jpeg)$/;
+ $file=~/\.(png|gif|jpg|jpeg)$/i;
} #}}}
sub pagetitle ($) { #{{{
return $page;
} #}}}
-sub htmllink ($$;$$) { #{{{
+sub htmllink ($$;$$$) { #{{{
my $page=shift;
my $link=shift;
my $noimageinline=shift; # don't turn links into inline html images
my $forcesubpage=shift; # force a link to a subpage
+ my $linktext=shift; # set to force the link text to something
my $bestlink;
if (! $forcesubpage) {
$bestlink="$page/".lc($link);
}
- my $linktext=pagetitle($link);
+ $linktext=pagetitle(basename($link)) unless defined $linktext;
return $linktext if length $bestlink && $page eq $bestlink;
loadindex();
require IkiWiki::Render;
rcs_update();
+ rcs_getctime() if $config{getctime};
refresh();
saveindex();
}