From: joey Date: Thu, 23 Mar 2006 08:10:09 +0000 (+0000) Subject: prototyping improvements X-Git-Tag: 1.0~258 X-Git-Url: http://git.tremily.us/?p=ikiwiki.git;a=commitdiff_plain;h=28055bbcc5c8e6371c7eaa7a0465a9e311a01764 prototyping improvements --- diff --git a/README b/README index e9ee15dfe..454aa843b 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -Use ./Makefile.PL to generate a Makefile, "make" will generate docs and a -man page, and "make install" will install ikiwiki. +Use ./Makefile.PL to generate a Makefile, "make" will build the +documentation wiki and a man page, and "make install" will install ikiwiki. All other documentation is in the ikiwiki documentation wiki. diff --git a/ikiwiki b/ikiwiki index a9a0c8ff4..dd5758b3a 100755 --- a/ikiwiki +++ b/ikiwiki @@ -81,7 +81,7 @@ sub getconfig () { #{{{ } } #}}} -sub checkconfig { #{{{ +sub checkconfig () { #{{{ if ($config{cgi} && ! length $config{url}) { error("Must specify url to wiki with --url when using --cgi"); } @@ -99,11 +99,7 @@ sub checkconfig { #{{{ } } #}}} -sub usage { #{{{ - die "usage: ikiwiki [options] source dest\n"; -} #}}} - -sub error { #{{{ +sub error ($) { #{{{ if ($config{cgi}) { print "Content-type: text/html\n\n"; print misctemplate("Error", "

Error: @_

"); @@ -111,6 +107,16 @@ sub error { #{{{ die @_; } #}}} +sub usage () { #{{{ + die "usage: ikiwiki [options] source dest\n"; +} #}}} + +sub possibly_foolish_untaint ($) { #{{{ + my $tainted=shift; + my ($untainted)=$tainted=~/(.*)/; + return $untainted; +} #}}} + sub debug ($) { #{{{ return unless $config{verbose}; if (! $config{cgi}) { @@ -121,12 +127,6 @@ sub debug ($) { #{{{ } } #}}} -sub possibly_foolish_untaint { #{{{ - my $tainted=shift; - my ($untainted)=$tainted=~/(.*)/; - return $untainted; -} #}}} - sub basename ($) { #{{{ my $file=shift; @@ -236,7 +236,7 @@ sub isinlinableimage ($) { #{{{ $file=~/\.(png|gif|jpg|jpeg)$/; } #}}} -sub htmllink { #{{{ +sub htmllink ($$;$$) { #{{{ my $page=shift; my $link=shift; my $noimageinline=shift; # don't turn links into inline html images