add example wrapper and fix formatting
authorJoey Hess <joey@kodama.kitenet.net>
Sat, 26 Jul 2008 23:49:45 +0000 (19:49 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Sat, 26 Jul 2008 23:49:45 +0000 (19:49 -0400)
IkiWiki.pm
IkiWiki/Setup/Standard.pm

index 2f274f3845145884403f1c5330128d1cef2cce73..c7c5aaf979fd8d265cd1e740355508b341197809 100644 (file)
@@ -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,
index e82425c71162c54aa1eac24fa9f1c4574a6e8a74..d1c53c0645c242dd5c3c4974156d66c00607f819 100644 (file)
@@ -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,";