add_idx(): Don't add unnecessary markup around the little markers stuck in the

index to cross-references; an image doesn't benefit by being bold!
This commit is contained in:
Fred Drake 1997-12-11 21:46:07 +00:00
parent 9e326665cf
commit d56924258a
1 changed files with 27 additions and 27 deletions

View File

@ -1,7 +1,7 @@
#LaTeX2HTML Version 96.1 : dot.latex2html-init -*- perl -*- #LaTeX2HTML Version 96.1 : dot.latex2html-init -*- perl -*-
# #
$INFO = 1; # 0 = do not make a "About this document..." section $INFO = 1; # 0 = do not make a "About this document..." section
$MAX_LINK_DEPTH = 3; $MAX_LINK_DEPTH = 3;
# Python documentation uses section numbers to support references to match # Python documentation uses section numbers to support references to match
@ -60,7 +60,7 @@ sub process_command {
# $ref_before may also be modified ... # $ref_before may also be modified ...
$after = &$cmd_msub($after, @open_font_tags); $after = &$cmd_msub($after, @open_font_tags);
if ( !$math_mode ) { if ( !$math_mode ) {
$after = "<MATH>" . $after . "</MATH>"; $after = "<math>" . $after . "</math>";
++$commands_outside_math{$cmd}; ++$commands_outside_math{$cmd};
}; };
} }
@ -73,7 +73,7 @@ sub process_command {
if ( $math_mode ) { if ( $math_mode ) {
$after = "&$mathentity;" . $after; $after = "&$mathentity;" . $after;
} else { } else {
$after = "<MATH>&$mathentity;</MATH>" . $after; $after = "<math>&$mathentity;</math>" . $after;
++$commands_outside_math{$cmd}; ++$commands_outside_math{$cmd};
}; } }; }
# Here's the hack: # Here's the hack:
@ -100,42 +100,42 @@ sub top_navigation_panel {
# Now add a few buttons with a space between them # Now add a few buttons with a space between them
"<DIV CLASS=navigation>\n" . "<DIV CLASS=navigation>\n" .
"$NEXT $UP $PREVIOUS $CONTENTS $INDEX $CUSTOM_BUTTONS" . "$NEXT $UP $PREVIOUS $CONTENTS $INDEX $CUSTOM_BUTTONS" .
"<BR>\n" . # Line break "<BR>\n" . # Line break
# If ``next'' section exists, add its title to the navigation panel # If ``next'' section exists, add its title to the navigation panel
($NEXT_TITLE ? "<B> Next:</B> $NEXT_TITLE\n" : undef) . ($NEXT_TITLE ? "<B> Next:</B> $NEXT_TITLE\n" : undef) .
# Similarly with the ``up'' title ... # Similarly with the ``up'' title ...
($UP_TITLE ? "<B>Up:</B> $UP_TITLE\n" : undef) . ($UP_TITLE ? "<B>Up:</B> $UP_TITLE\n" : undef) .
# ... and the ``previous'' title # ... and the ``previous'' title
($PREVIOUS_TITLE ? "<B> Previous:</B> $PREVIOUS_TITLE\n" : undef) . ($PREVIOUS_TITLE ? "<B> Previous:</B> $PREVIOUS_TITLE\n" : undef) .
# Line Break, horizontal rule (3-d dividing line) and new paragraph # Line Break, horizontal rule (3-d dividing line) and new paragraph
"<BR><HR><P></DIV>\n" "<BR><HR><P></DIV>\n"
} }
sub bot_navigation_panel { sub bot_navigation_panel {
# Start with a horizontal rule (3-d dividing line) # Start with a horizontal rule (3-d dividing line)
"\n<DIV CLASS=navigation><HR>". "\n<div class=navigation><hr>".
# Now add a few buttons with a space between them # Now add a few buttons with a space between them
"$NEXT $UP $PREVIOUS $CONTENTS $INDEX $CUSTOM_BUTTONS" . "$NEXT $UP $PREVIOUS $CONTENTS $INDEX $CUSTOM_BUTTONS" .
"<BR>\n" . # Line break "<br>\n" . # Line break
# If ``next'' section exists, add its title to the navigation panel # If ``next'' section exists, add its title to the navigation panel
($NEXT_TITLE ? "<B> Next:</B> $NEXT_TITLE\n" : undef) . ($NEXT_TITLE ? "<b> Next:</b> $NEXT_TITLE\n" : undef) .
# Similarly with the ``up'' title ... # Similarly with the ``up'' title ...
($UP_TITLE ? "<B>Up:</B> $UP_TITLE\n" : undef) . ($UP_TITLE ? "<b>Up:</b> $UP_TITLE\n" : undef) .
# ... and the ``previous'' title # ... and the ``previous'' title
($PREVIOUS_TITLE ? "<B> Previous:</B> $PREVIOUS_TITLE\n" : undef) . ($PREVIOUS_TITLE ? "<b> Previous:</b> $PREVIOUS_TITLE\n" : undef) .
"</DIV>\n" "</div>\n"
} }
@ -148,14 +148,14 @@ sub make_str_index_entry {
# of the current section), use $ref_before. # of the current section), use $ref_before.
$TITLE = $ref_before unless $TITLE; $TITLE = $ref_before unless $TITLE;
# Save the reference # Save the reference
local($nstr) = "$str###" . ++$global{'max_id'}; # Make unique local($nstr) = "$str###" . ++$global{'max_id'}; # Make unique
$index{$nstr} .= &make_half_href("$CURRENT_FILE#$br_id"); $index{$nstr} .= &make_half_href("$CURRENT_FILE#$br_id");
"<a name=\"$br_id\">$str<\/a>"; "<a name=\"$br_id\">$str<\/a>";
} }
sub add_idx { sub add_idx {
print "\nDoing the index ..."; print "\nDoing the index ...";
local($key, $str, @keys, $index, $level, $count, local($key, $str, @keys, $index, $level, $count,
@previous, @current); @previous, @current);
@keys = keys %index; @keys = keys %index;
@keys = sort keysort @keys; @keys = sort keysort @keys;
@ -169,11 +169,11 @@ sub add_idx {
while ($count > $level) { while ($count > $level) {
$index .= "<dl compact>\n"; $index .= "<dl compact>\n";
$level++; $level++;
} }
while ($count < $level) { while ($count < $level) {
$index .= "</dl>\n"; $index .= "</dl>\n";
$level--; $level--;
} }
foreach $term (@current[$count .. $#current-1]) { foreach $term (@current[$count .. $#current-1]) {
# need to "step in" a little # need to "step in" a little
$index .= "<dt>" . $term . "\n<dl compact>\n"; $index .= "<dt>" . $term . "\n<dl compact>\n";
@ -184,14 +184,14 @@ sub add_idx {
$index .= #$index{$key} . $index .= #$index{$key} .
# If it's the same string don't start a new line # If it's the same string don't start a new line
(&index_key_eq(join('',@current), join('',@previous)) ? (&index_key_eq(join('',@current), join('',@previous)) ?
", $index{$key}<strong>" . $cross_ref_visible_mark . "</strong></a>\n" : ", $index{$key}" . $cross_ref_visible_mark . "</a>\n" :
"<dt>$index{$key}<strong>" . $str . "</strong></a>\n"); "<dt>$index{$key}<strong>" . $str . "</strong></a>\n");
@previous = @current; @previous = @current;
} }
while ($count < $level) { while ($count < $level) {
$index .= "</dl>\n"; $index .= "</dl>\n";
$level--; $level--;
} }
s/$idx_mark/<dl compact>$index<\/dl>/o; s/$idx_mark/<dl compact>$index<\/dl>/o;
} }