]> granicus.if.org Git - python/commitdiff
make_mod_index_entry(): New function. Create the index entry for a module.
authorFred Drake <fdrake@acm.org>
Wed, 17 Dec 1997 02:59:39 +0000 (02:59 +0000)
committerFred Drake <fdrake@acm.org>
Wed, 17 Dec 1997 02:59:39 +0000 (02:59 +0000)
my_module_index_helper():  Do the actual work for \*modindex{}, including
both the defining and reference forms.

make_str_index_entry():  Moved from .latex2html-init; it's really specific
to the presentation.

Doc/myformat.perl

index f60bf1a20c80875a64b4a064f03b93afe12cfe1f..f4b147c6022297f9fbca392bd457d5b9d854ea2c 100644 (file)
@@ -153,13 +153,32 @@ sub my_parword_index_helper{
        &make_index_entry($br_id, "$str ($word)") . $_;
 }
 
+sub make_mod_index_entry {
+    local($br_id,$str,$define) = @_;
+    # 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
+    $str = &gen_index_id($str, $define);
+    $index{$str} .= &make_half_href("$CURRENT_FILE#$br_id");
+    "<A NAME=\"$br_id\">$anchor_invisible_mark<\/A>";
+}
+
+sub my_module_index_helper{
+       local($word, $_, $define) = @_;
+       s/$next_pair_pr_rx//o;
+       local($br_id, $str) = ($1, $2);
+       &make_mod_index_entry($br_id, "<tt>$str</tt> ($word module)",
+                             $define) . $_;
+}
+
 sub do_cmd_bifuncindex{ &my_parword_index_helper('built-in function', @_); }
-sub do_cmd_bimodindex{ &my_parword_index_helper('built-in module', @_); }
-sub do_cmd_stmodindex{ &my_parword_index_helper('standard module', @_); }
+sub do_cmd_bimodindex{ &my_module_index_helper('built-in', @_, 'DEF'); }
+sub do_cmd_stmodindex{ &my_module_index_helper('standard', @_, 'DEF'); }
 sub do_cmd_bifuncindex{ &my_parword_index_helper('standard module', @_); }
 
-sub do_cmd_refbimodindex{ &my_parword_index_helper('built-in module', @_); }
-sub do_cmd_refstmodindex{ &my_parword_index_helper('standard module', @_); }
+sub do_cmd_refbimodindex{ &my_module_index_helper('built-in', @_, 'REF'); }
+sub do_cmd_refstmodindex{ &my_module_index_helper('standard', @_, 'REF'); }
 
 sub do_cmd_nodename{ &do_cmd_label(@_); }
 
@@ -172,6 +191,20 @@ sub get_indexsubitem{
   $result;
 }
 
+# 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) = &gen_index_id($str, '');
+    $index{$nstr} .= &make_half_href("$CURRENT_FILE#$br_id");
+    "<a name=\"$br_id\">$str<\/a>";
+}
+
 sub do_env_cfuncdesc{
   local($_) = @_;
   local($return_type,$function_name,$arg_list,$idx) = ('', '', '', '');