", "
");
my $children = $current_element->{'section_childs'};
foreach ( @$children ) {
push (@toc_entries, generate_ly_toc_entries($_, \%parentelements, $page_toc_depth));
}
push (@toc_entries, "
");
push (@toc_entries, "
");
return @toc_entries;
}
# Create the custom TOC for this page (partially folded, current page is
# highlighted) and store it in a global variable. The TOC is written out after
# the html contents (but positioned correctly using CSS), so that browsers with
# css turned off still show the contents first.
my @this_page_toc = ();
sub lilypond_print_element_header
{
my $fh = shift;
my $first_in_page = shift;
my $previous_is_top = shift;
if ($first_in_page and not @this_page_toc) {
if (defined($Texi2HTML::THIS_ELEMENT)) {
# Create the TOC for this page
@this_page_toc = lilypond_generate_page_toc_body($Texi2HTML::THIS_ELEMENT);
}
}
return T2H_DEFAULT_print_element_header( $fh, $first_in_page, $previous_is_top);
}
# Generate the HTML output for the TOC
sub lilypond_toc_body($)
{
my $elements_list = shift;
# Generate a default TOC for pages without THIS_ELEMENT
@default_toc = lilypond_generate_page_toc_body(@$elements_list[0]);
return T2H_GPL_toc_body($elements_list);
}
# Print out the TOC in a at the end of th page, which will be formatted as a
# sidebar mimicking a TOC frame
sub print_lilypond_page_foot($)
{
my $fh = shift;
my $program_string = &$program_string();
print $fh "
$program_string
$PRE_BODY_CLOSE
\n";
# Print the TOC frame:
my @lines = @this_page_toc;
# use default TOC if no custom lines have been generated
@lines = @default_toc if (not @lines);
if (@lines) {
print $fh "\n\n
";
print $fh '
' . $Texi2HTML::NAME{'Contents'} . "
\n";
foreach my $line (@lines) {
print $fh $line;
}
print $fh "";
@this_page_toc = ();
}
# Close the page:
print $fh "