move generic comment into IkiWiki::Setup

master
Joey Hess 2010-03-19 15:35:21 -04:00
parent 522daa7ea8
commit bbe1f2e493
2 changed files with 11 additions and 9 deletions

View File

@ -52,7 +52,14 @@ sub dump ($) {
eval qq{require $config{setuptype}}; eval qq{require $config{setuptype}};
error $@ if $@; error $@ if $@;
my @dump=$config{setuptype}->gendump("Setup file for ikiwiki."); my @dump=$config{setuptype}->gendump(
"Setup file for ikiwiki.",
"",
"Passing this to ikiwiki --setup will make ikiwiki generate",
"wrappers and build the wiki.",
"",
"Remember to re-run ikiwiki --setup any time you edit this file.",
);
open (OUT, ">", $file) || die "$file: $!"; open (OUT, ">", $file) || die "$file: $!";
print OUT "$_\n" foreach @dump; print OUT "$_\n" foreach @dump;

View File

@ -12,20 +12,15 @@ sub import {
IkiWiki::Setup::merge($_[1]); IkiWiki::Setup::merge($_[1]);
} }
sub gendump ($$) { sub gendump ($@) {
my $class=shift; my $class=shift;
my $description=shift;
"#!/usr/bin/perl", "#!/usr/bin/perl",
"# $description",
"#", "#",
"# Passing this to ikiwiki --setup will make ikiwiki generate", (map { "# $_" } @_),
"# wrappers and build the wiki.",
"#",
"# Remember to re-run ikiwiki --setup any time you edit this file.",
"use IkiWiki::Setup::Standard {", "use IkiWiki::Setup::Standard {",
IkiWiki::Setup::commented_dump(\&dumpline), IkiWiki::Setup::commented_dump(\&dumpline),
"}"; "}"
} }
sub dumpline ($$$$) { sub dumpline ($$$$) {