summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-04-26 18:05:24 (GMT)
committerFred Drake <fdrake@acm.org>2000-04-26 18:05:24 (GMT)
commit37cc0c0e9f0f1e731c00c340587a1811ba1677ad (patch)
treec1c114da5fda5d70c4ead95c9419ab204b6100c2 /Doc
parentff2d9b71547d95566416fa968872910ca9c4adb1 (diff)
downloadcpython-37cc0c0e9f0f1e731c00c340587a1811ba1677ad.zip
cpython-37cc0c0e9f0f1e731c00c340587a1811ba1677ad.tar.gz
cpython-37cc0c0e9f0f1e731c00c340587a1811ba1677ad.tar.bz2
ref_module_index_helper(): Use "my" instead of "local".
get_rfc_url(): New function; returns the URL for a numbered IETF RFC. do_cmd_rfc(): Use get_rfc_url() instead of hard-coding in the HTML formatting. do_cmd_seerfc(): New function. do_env_definitions(): Small change to avoid "local".
Diffstat (limited to 'Doc')
-rw-r--r--Doc/perl/python.perl27
1 files changed, 22 insertions, 5 deletions
diff --git a/Doc/perl/python.perl b/Doc/perl/python.perl
index d4e8ea8..2866a36 100644
--- a/Doc/perl/python.perl
+++ b/Doc/perl/python.perl
@@ -229,12 +229,16 @@ sub do_cmd_manpage{
return "<span class='manpage'><i>$page</i>($section)</span>" . $_;
}
+sub get_rfc_url{
+ my $rfcnum = sprintf("%04d", @_[0]);
+ return "http://www.ietf.org/rfc/rfc$rfcnum.txt";
+}
+
sub do_cmd_rfc{
local($_) = @_;
my $rfcnumber = next_argument();
my $id = "rfcref-" . ++$global{'max_id'};
- my $href =
- "http://info.internet.isi.edu/in-notes/rfc/files/rfc$rfcnumber.txt";
+ my $href = get_rfc_url($rfcnumber);
# Save the reference
my $nstr = gen_index_id("RFC!RFC $rfcnumber", '');
$index{$nstr} .= make_half_href("$CURRENT_FILE#$id");
@@ -547,7 +551,7 @@ sub do_cmd_exmodindex{ return my_module_index_helper('extension', @_); }
sub do_cmd_stmodindex{ return my_module_index_helper('standard', @_); }
sub ref_module_index_helper{
- local($word, $ahref) = @_;
+ my($word, $ahref) = @_;
my $str = next_argument();
$word = "$word " if $word;
$str = "<tt class='module'>$str</tt> (${word}module)";
@@ -1265,6 +1269,20 @@ sub do_cmd_seemodule{
. $_;
}
+sub do_cmd_seerfc{
+ local($_) = @_;
+ my $rfcnum = next_argument();
+ my $title = next_argument();
+ my $text = next_argument();
+ my $url = get_rfc_url($rfcnum);
+ return '<dl compact class="seerfc">'
+ . "\n <dt><a href=\"$url\""
+ . "\n title=\"$title\""
+ . "\n >RFC $rfcnum, <em>$title</em></a>:"
+ . "\n <dd>$text\n </dl>"
+ . $_;
+}
+
sub do_cmd_seetext{
local($_) = @_;
my $content = next_argument();
@@ -1277,8 +1295,7 @@ sub do_cmd_seetext{
#
sub do_env_definitions{
- local($_) = @_;
- return "<dl class='definitions'>$_</dl>\n";
+ return "<dl class='definitions'>" . @_[0] . "</dl>\n";
}
sub do_cmd_term{