diff --git a/wiki-tile.pl b/wiki-tile.pl index 346196c..f88df88 100644 --- a/wiki-tile.pl +++ b/wiki-tile.pl @@ -282,13 +282,22 @@ if($html_document) open (my $fh, "> $outfile") or croak "Couldn't open $outfile for writing: $!"; say $fh wrap_in_html($grid); close $fh; + if($regiondir) + { + chdir $regiondir || croak "Couldn't chdir to $regiondir: $!"; + while(my ($region, $region_grid) = each %region_grids) + { + open (my $region_fh, "> $region.html") or croak "Couldn't open $region.html for writing: $!"; + say $region_fh wrap_in_html($region_grid); + close $region_fh; + } + } } else { open (my $fh, "> $outfile") or croak "Couldn't open $outfile for writing: $!"; say $fh $grid->render; close $fh; - say STDERR $regiondir; if($regiondir) { chdir $regiondir || croak "Couldn't chdir to $regiondir: $!";