diff options
author | Fred Drake <fdrake@acm.org> | 1997-12-03 19:44:27 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 1997-12-03 19:44:27 (GMT) |
commit | f2d7e5528ddf045307174ec2b1c3fa4c5c6e63f3 (patch) | |
tree | 937a407014ea8c81822afc29e2f28fc8bc76b976 /Doc | |
parent | ab76af3d65812005f254166433efde43554431ad (diff) | |
download | cpython-f2d7e5528ddf045307174ec2b1c3fa4c5c6e63f3.zip cpython-f2d7e5528ddf045307174ec2b1c3fa4c5c6e63f3.tar.gz cpython-f2d7e5528ddf045307174ec2b1c3fa4c5c6e63f3.tar.bz2 |
make_str_index_entry(): New function. Similar to make_index_entry(), but
includes the string in the returned value instead of the dummy
filler character.
add_idx(): Override the latex2html function of the same name; this gets
the anchor properly embedded in the <dt> element, so the index
works in Grail too.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/.latex2html-init | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/Doc/.latex2html-init b/Doc/.latex2html-init index 481b956..9696293 100644 --- a/Doc/.latex2html-init +++ b/Doc/.latex2html-init @@ -95,4 +95,105 @@ sub process_command { $ref_contents; } +sub top_navigation_panel { + + # Now add a few buttons with a space between them + "<DIV CLASS=navigation>\n" . + "$NEXT $UP $PREVIOUS $CONTENTS $INDEX $CUSTOM_BUTTONS" . + + "<BR>\n" . # Line break + + # If ``next'' section exists, add its title to the navigation panel + ($NEXT_TITLE ? "<B> Next:</B> $NEXT_TITLE\n" : undef) . + + # Similarly with the ``up'' title ... + ($UP_TITLE ? "<B>Up:</B> $UP_TITLE\n" : undef) . + + # ... and the ``previous'' title + ($PREVIOUS_TITLE ? "<B> Previous:</B> $PREVIOUS_TITLE\n" : undef) . + + # Line Break, horizontal rule (3-d dividing line) and new paragraph + "<BR><HR><P></DIV>\n" +} + +sub bot_navigation_panel { + + # Start with a horizontal rule (3-d dividing line) + "\n<DIV CLASS=navigation><HR>". + + # Now add a few buttons with a space between them + "$NEXT $UP $PREVIOUS $CONTENTS $INDEX $CUSTOM_BUTTONS" . + + "<BR>\n" . # Line break + + # If ``next'' section exists, add its title to the navigation panel + ($NEXT_TITLE ? "<B> Next:</B> $NEXT_TITLE\n" : undef) . + + # Similarly with the ``up'' title ... + ($UP_TITLE ? "<B>Up:</B> $UP_TITLE\n" : undef) . + + # ... and the ``previous'' title + ($PREVIOUS_TITLE ? "<B> Previous:</B> $PREVIOUS_TITLE\n" : undef) . + + "</DIV>\n" +} + + +# similar to make_index_entry(), but includes the string in the result +# instead of the dummy filler. +# +sub make_str_index_entry { + local($br_id,$str) = @_; + # If TITLE is not yet available (i.e the \index command is in the title + # of the current section), use $ref_before. + $TITLE = $ref_before unless $TITLE; + # Save the reference + local($nstr) = "$str###" . ++$global{'max_id'}; # Make unique + $index{$nstr} .= &make_half_href("$CURRENT_FILE#$br_id"); + "<a name=\"$br_id\">$str<\/a>"; +} + +sub add_idx { + print "\nDoing the index ..."; + local($key, $str, @keys, $index, $level, $count, + @previous, @current); + @keys = keys %index; + @keys = sort keysort @keys; + $level = 0; + foreach $key (@keys) { + @current = split(/!/, $key); + $count = 0; + while ($current[$count] eq $previous[$count]) { + $count++; + } + while ($count > $level) { + $index .= "<dl compact>\n"; + $level++; + } + while ($count < $level) { + $index .= "</dl>\n"; + $level--; + } + foreach $term (@current[$count .. $#current-1]) { + # need to "step in" a little + $index .= "<dt>" . $term . "\n<dl compact>\n"; + $level++; + } + $str = $current[$#current]; + $str =~ s/\#\#\#\d+$//o; # Remove the unique id's + $index .= #$index{$key} . + # If it's the same string don't start a new line + (&index_key_eq(join('',@current), join('',@previous)) ? + ", $index{$key}<strong>" . $cross_ref_visible_mark . "</strong></a>\n" : + "<dt>$index{$key}<strong>" . $str . "</strong></a>\n"); + @previous = @current; + } + while ($count < $level) { + $index .= "</dl>\n"; + $level--; + } + s/$idx_mark/<dl compact>$index<\/dl>/o; +} + + 1; # This must be the last line |