From 38618838c9f2700b3971c436ec9bee98b91a21e5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 26 Jul 2008 19:49:45 -0400 Subject: [PATCH] add example wrapper and fix formatting --- IkiWiki.pm | 8 +++++++- IkiWiki/Setup/Standard.pm | 10 ++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) 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,"; -- 2.26.2