]> granicus.if.org Git - python/commitdiff
Don't assume the name of the table of contents will be contents.html;
authorFred Drake <fdrake@acm.org>
Fri, 27 Jun 2003 18:26:01 +0000 (18:26 +0000)
committerFred Drake <fdrake@acm.org>
Fri, 27 Jun 2003 18:26:01 +0000 (18:26 +0000)
that won't be right when mkhowto is called with --numeric (as it is
for the Python Tutorial).  Save the actual name we use when we build
the table of contents, then use that in the page head metadata.  The
node2label.pl script will munge this properly when --numeric isn't
given, so this works in both cases.
Closes SF bug #761830.

Doc/perl/l2hinit.perl

index 0ecb693d80fa9b3feaf20c01d231d7f05db5e489..2164ace27d2f61984fb5a27953747c0df5a93649 100644 (file)
@@ -401,12 +401,14 @@ sub add_idx_hook {
 
 # In addition to the standard stuff, add label to allow named node files and
 # support suppression of the page complete (for HTML Help use).
+$MY_CONTENTS_PAGE = '';
 sub do_cmd_tableofcontents {
     local($_) = @_;
     $TITLE = $toc_title;
     $tocfile = $CURRENT_FILE;
     my($closures, $reopens) = preserve_open_tags();
     anchor_label('contents', $CURRENT_FILE, $_);       # this is added
+    $MY_CONTENTS_PAGE = "$CURRENT_FILE";
     join('', "<BR>\n\\tableofchildlinks[off]", $closures
         , make_section_heading($toc_title, 'H2'), $toc_mark
         , $reopens, $_);
@@ -652,7 +654,8 @@ sub make_head_and_body($$) {
             ($t_title ? " title='$t_title'" : ''),
             '>',
             ($HAVE_TABLE_OF_CONTENTS
-             ? "\n<link rel='contents' href='contents.html' title='Contents'>"
+             ? ("\n<link rel='contents' href='$MY_CONTENTS_PAGE'"
+                . ' title="Contents">')
              : ''),
             ($HAVE_GENERAL_INDEX
              ? "\n<link rel='index' href='genindex.html' title='Index'>"