summaryrefslogtreecommitdiffstats
path: root/Doc/myformat.perl
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1998-02-18 22:45:53 (GMT)
committerFred Drake <fdrake@acm.org>1998-02-18 22:45:53 (GMT)
commitce0e17555424a90d6dd3f5ae8f4e586280dc3b44 (patch)
treead4cc2bc23b56635edf11acdbfe54aaeb86ee4f3 /Doc/myformat.perl
parent026d9626dfca51a6cd72a18c32f38f69db2e601d (diff)
downloadcpython-ce0e17555424a90d6dd3f5ae8f4e586280dc3b44.zip
cpython-ce0e17555424a90d6dd3f5ae8f4e586280dc3b44.tar.gz
cpython-ce0e17555424a90d6dd3f5ae8f4e586280dc3b44.tar.bz2
&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 <A NAME=...> 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 "&#160;"'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.
Diffstat (limited to 'Doc/myformat.perl')
-rw-r--r--Doc/myformat.perl51
1 files changed, 40 insertions, 11 deletions
diff --git a/Doc/myformat.perl b/Doc/myformat.perl
index 13f929b..baa9b90 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/<tt><font face=sans-serif>\2<\/font><\/tt>/;
+ $_;
+}
+
sub do_cmd_url{
# use the URL as both text and hyperlink
local($_) = @_;
- s/$any_next_pair_pr_rx/<tt><a href="\2">\2<\/a><\/tt>/;
- $_;
+ s/$any_next_pair_pr_rx//;
+ local($url) = $2;
+ "<tt><font face=sans-serif><a href=\"$url\">$url</a></font></tt>" . $_;
}
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",
+ "<tt>$str</tt> ($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, "<tt>$str</tt> ($word module)",
- $define) . $_;
+ &make_mod_index_entry($br_id, "<tt>$str</tt> ($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/<p><tt><b>\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";
+ "<p>Module <tt><b><a href=\"$node#$key\">$module</a></b></tt>"
+ . "&nbsp;&nbsp;&nbsp;($text)</p>"
+ . $_;
}
sub do_cmd_seetext{