summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-07-26 19:49:45 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-07-26 19:49:45 -0400
commit38618838c9f2700b3971c436ec9bee98b91a21e5 (patch)
treeebae7a7a5157e6acaeb224ea37c0ae3a450e40bf
parentc56618133cc3e0106e75b63cf91906037ea629ea (diff)
add example wrapper and fix formatting
-rw-r--r--IkiWiki.pm8
-rw-r--r--IkiWiki/Setup/Standard.pm10
2 files changed, 17 insertions, 1 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 2f274f384..c7c5aaf97 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -119,7 +119,13 @@ sub getsetup () { #{{{
},
wrappers => {
type => "string",
- default => undef,
+ example => [
+ {
+ cgi => 1,
+ wrapper => "/var/www/wiki/ikiwiki.cgi",
+ wrappermode => "06755",
+ },
+ ],
description => "definitions of wrappers to generate",
safe => 0,
rebuild => 0,
diff --git a/IkiWiki/Setup/Standard.pm b/IkiWiki/Setup/Standard.pm
index e82425c71..d1c53c064 100644
--- a/IkiWiki/Setup/Standard.pm
+++ b/IkiWiki/Setup/Standard.pm
@@ -40,7 +40,17 @@ sub dumpline ($$$$) { #{{{
else {
$dumpedvalue=Dumper($value);
chomp $dumpedvalue;
+ if (length $prefix) {
+ # add to second and subsequent lines
+ my @lines=split(/\n/, $dumpedvalue);
+ $dumpedvalue="";
+ for (my $x=0; $x <= $#lines; $x++) {
+ $lines[$x] =~ s/^\t//;
+ $dumpedvalue.="\t".($x ? $prefix : "").$lines[$x]."\n";
+ }
+ }
$dumpedvalue=~s/^\t//;
+ chomp $dumpedvalue;
}
return "\t$prefix$key => $dumpedvalue,";