From ce0e17555424a90d6dd3f5ae8f4e586280dc3b44 Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Wed, 18 Feb 1998 22:45:53 +0000 Subject: [PATCH] &do_cmd_url, &do_cmd_email: Adjust to use a font similar to that used in the printed representation. &my_module_index_helper: Change to be only used for defining markup. Don't prepend an to the result; use the containing page as the module target for the index. &ref_module_index_helper: New function. Used only for references to modules described elsewhere. Generate the right target. &init_myformat: Set the anchor_mark to an empty string; this avoids junky " "'s in the text, which could really screw up vertical spacing when that's all that's in a paragraph. &do_cmd_seemodule: Insert markup to jump right to the referred-to module. --- Doc/myformat.perl | 51 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/Doc/myformat.perl b/Doc/myformat.perl index 13f929b2d6f..baa9b909735 100644 --- a/Doc/myformat.perl +++ b/Doc/myformat.perl @@ -58,11 +58,18 @@ sub do_cmd_method{ &do_cmd_code(@_); } sub do_cmd_email{ &do_cmd_code(@_); } sub do_cmd_program{ &do_cmd_code(@_); } +sub do_cmd_email{ + local($_) = @_; + s/$any_next_pair_pr_rx/\2<\/font><\/tt>/; + $_; +} + sub do_cmd_url{ # use the URL as both text and hyperlink local($_) = @_; - s/$any_next_pair_pr_rx/\2<\/a><\/tt>/; - $_; + s/$any_next_pair_pr_rx//; + local($url) = $2; + "$url" . $_; } sub do_cmd_manpage{ @@ -225,24 +232,36 @@ sub make_mod_index_entry{ } sub my_module_index_helper{ - local($word, $_, $define) = @_; + local($word, $_) = @_; + s/$next_pair_pr_rx[\n]*//o; + local($br_id, $str) = ($1, $2); + local($section_tag) = join('', @curr_sec_id); + &make_mod_index_entry("SECTION$section_tag", + "$str ($word module)", 'DEF'); + $_; +} + +sub ref_module_index_helper{ + local($word, $_) = @_; s/$next_pair_pr_rx//o; local($br_id, $str) = ($1, $2); - &make_mod_index_entry($br_id, "$str ($word module)", - $define) . $_; + &make_mod_index_entry($br_id, "$str ($word module)", 'REF') . $_; } sub do_cmd_bifuncindex{ &my_parword_index_helper('built-in function', @_); } -sub do_cmd_bimodindex{ &my_module_index_helper('built-in', @_, 'DEF'); } -sub do_cmd_stmodindex{ &my_module_index_helper('standard', @_, 'DEF'); } +sub do_cmd_bimodindex{ &my_module_index_helper('built-in', @_); } +sub do_cmd_stmodindex{ &my_module_index_helper('standard', @_); } -sub do_cmd_refbimodindex{ &my_module_index_helper('built-in', @_, 'REF'); } -sub do_cmd_refstmodindex{ &my_module_index_helper('standard', @_, 'REF'); } +# these should be adjusted a bit.... +sub do_cmd_refbimodindex{ &ref_module_index_helper('built-in', @_); } +sub do_cmd_refstmodindex{ &ref_module_index_helper('standard', @_); } sub do_cmd_nodename{ &do_cmd_label(@_); } sub init_myformat{ # XXX need some way for this to be called after &initialise; + $anchor_mark = ''; + $icons{'anchor_mark'} = ''; # <<2>>...<<2>> $any_next_pair_rx3 = "$O(\\d+)$C([\\s\\S]*)$O\\3$C"; $any_next_pair_rx5 = "$O(\\d+)$C([\\s\\S]*)$O\\5$C"; @@ -526,10 +545,20 @@ sub do_env_seealso{ } sub do_cmd_seemodule{ + # Insert the right magic to jump to the module definition. This should + # work most of the time, at least for repeat builds.... local($_) = @_; local($any_next_pair_pr_rx3) = "$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP"; - s/$next_pair_pr_rx$any_next_pair_pr_rx3/

\2<\/b><\/tt> (\4)<\/p>/; - $_; + s/$next_pair_pr_rx$any_next_pair_pr_rx3//; + local($module,$text,$node,$key) = ($2, $4, '', "module$2"); + $key =~ s/_//g; +# $node = $external_labels{$key} unless +# ($node = $ref_files{$key}); + $node = $key; + print "seemodule $module: $node#$key\n"; + "

Module $module" + . "   ($text)

" + . $_; } sub do_cmd_seetext{