Skip to content

Commit

Permalink
disabled TOC creation
Browse files Browse the repository at this point in the history
  • Loading branch information
barbie committed Aug 21, 2011
1 parent b4b5b58 commit f8cdd7c
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions build/tools/build_chapters.pl
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
for my $chapter (get_chapter_list())
{
my $text = process_chapter( $chapter, $sections_href );
push @TOC, write_chapter( $chapter, $text );
write_chapter( $chapter, $text );
#push @TOC, write_chapter( $chapter, $text );
}

die( "Scenes missing from chapters:", join "\n\t", '', keys %$sections_href )
if keys %$sections_href;

write_toc(\@TOC);
#write_toc(\@TOC);

exit;

Expand Down Expand Up @@ -97,18 +98,18 @@ sub write_chapter

mkpath( $chapter_dir ) unless -e $chapter_dir;

my @toc;
my @text = split(m!$/!,$text);
for my $line (@text) {
if($line =~ /^=head(\d) (.*?)\s*$/) {
my ($level,$title,$ref) = ($1,$2,$2);
$ref =~ s/ /_/g;
$ref =~ s/[^\w -]/-/g;
$ref .= "_$level";
$text =~ s/(=head$level $title)/Z<$ref>\n\n$1/;
push @toc, [$level, $title, $ref, $name];
}
}
#my @toc;
#my @text = split(m!$/!,$text);
#for my $line (@text) {
# if($line =~ /^=head(\d) (.*?)\s*$/) {
# my ($level,$title,$ref) = ($1,$2,$2);
# $ref =~ s/ /_/g;
# $ref =~ s/[^\w -]/-/g;
# $ref .= "_$level";
# $text =~ s/(=head$level $title)/$1 Z<$ref>/;
# push @toc, [$level, $title, $ref, $name];
# }
#}

open my $fh, '>:utf8', $chapter_path
or die "Cannot write '$chapter_path': $!\n";
Expand All @@ -122,7 +123,7 @@ sub write_chapter
or die "Cannot write '$chapter_path': $!\n";

print {$fha} $text;
return @toc;
#return @toc;
}

sub write_toc
Expand Down

0 comments on commit f8cdd7c

Please sign in to comment.