From f2d7e5528ddf045307174ec2b1c3fa4c5c6e63f3 Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Wed, 3 Dec 1997 19:44:27 +0000 Subject: 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
element, so the index works in Grail too. --- Doc/.latex2html-init | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) 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 + "\n" +} + +sub bot_navigation_panel { + + # Start with a horizontal rule (3-d dividing line) + "\n\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"); + "$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 .= "
\n"; + $level++; + } + while ($count < $level) { + $index .= "
\n"; + $level--; + } + foreach $term (@current[$count .. $#current-1]) { + # need to "step in" a little + $index .= "
" . $term . "\n
\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}" . $cross_ref_visible_mark . "\n" : + "
$index{$key}" . $str . "\n"); + @previous = @current; + } + while ($count < $level) { + $index .= "
\n"; + $level--; + } + s/$idx_mark/
$index<\/dl>/o; +} + + 1; # This must be the last line -- cgit v0.12