diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-07-07 21:00:48 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-07-07 21:00:48 +0000 |
commit | 1bdfa4d8b54763eee1c266e3516bb50dd864cedc (patch) | |
tree | 45bb961a8b4b2b790875c320f2c6e6e5d141de10 /IkiWiki.pm | |
parent | 1cd1f073fff6be0300dec80cf1571ca247ce24ab (diff) |
* Support a w3mmode, which lets w3m run ikiwiki using its local CGI
support, to edit pages etc without a web server.
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r-- | IkiWiki.pm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm index d8b272125..4964f97a1 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -34,6 +34,7 @@ sub defaultconfig () { #{{{ rebuild => 0, refresh => 0, getctime => 0, + w3mmode => 0, wrapper => undef, wrappermode => undef, svnrepo => undef, @@ -49,8 +50,17 @@ sub defaultconfig () { #{{{ plugin => [qw{mdwn inline htmlscrubber}], timeformat => '%c', } #}}} - + sub checkconfig () { #{{{ + if ($config{w3mmode}) { + eval q{use Cwd q{abs_path}}; + $config{srcdir}=possibly_foolish_untaint(abs_path($config{srcdir})); + $config{destdir}=possibly_foolish_untaint(abs_path($config{destdir})); + $config{cgiurl}="file:///\$LIB/ikiwiki-w3m.cgi/".$config{cgiurl} + unless $config{cgiurl} =~ m!file:///!; + $config{url}="file://".$config{destdir}; + } + if ($config{cgi} && ! length $config{url}) { error("Must specify url to wiki with --url when using --cgi\n"); } |