]> git.donarmstrong.com Git - lilypond.git/commitdiff
texi2html: Fix the parent detection of the TOC for unnumbered sections
authorReinhold Kainhofer <reinhold@kainhofer.com>
Tue, 22 Jul 2008 19:19:59 +0000 (21:19 +0200)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Tue, 22 Jul 2008 19:19:59 +0000 (21:19 +0200)
Instead of using the section number I'm now using the ID of the sections
to properly detect parents of the current page even if we only have
@unnumbered sections (as compared to @chapter). This fixes the snippets
page.

lilypond-texi2html.init

index 2388c5cdb909e7441b3ad24dd168a890ce8de0a7..e2d69c7390df2b6d11eabea8fa2a4a00d0e15766 100644 (file)
@@ -583,7 +583,7 @@ sub generate_ly_toc_entries($$$$)
   return() if (not defined($element) or exists($element->{'index_page'}));
   my @result = ();
   my $level = $element->{'toc_level'};
-  my $is_parent_of_current = $element->{'number'} && $element_path->{$element->{'number'}};
+  my $is_parent_of_current = $element->{'id'} && $element_path->{$element->{'id'}};
   my $print_children = ( ($level < $maxlevel) or $is_parent_of_current );
   my $ind = '  ' x $level;
   my $this_css_class = $is_parent_of_current ? " class=\"toc_current\"" : "";
@@ -622,13 +622,13 @@ sub lilypond_generate_page_toc_body($)
     my $element = shift;
     my $current_element = $element;
     my %parentelements;
-    $parentelements{$element->{'number'}} = 1;
+    $parentelements{$element->{'id'}} = 1;
     # Find the path to the current element
     while ( defined($current_element->{'sectionup'}) and
            ($current_element->{'sectionup'} ne $current_element) )
     {
-      $parentelements{$current_element->{'sectionup'}->{'number'}} = 1
-              if ($current_element->{'sectionup'}->{'number'} ne '');
+      $parentelements{$current_element->{'sectionup'}->{'id'}} = 1
+              if ($current_element->{'sectionup'}->{'id'} ne '');
       $current_element = $current_element->{'sectionup'};
     }
     return () if not defined($current_element);