From 37cc0c0e9f0f1e731c00c340587a1811ba1677ad Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Wed, 26 Apr 2000 18:05:24 +0000 Subject: 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". --- Doc/perl/python.perl | 27 ++++++++++++++++++++++----- 1 file 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 "$page($section)" . $_; } +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 = "$str (${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 '
' + . "\n
RFC $rfcnum, $title:" + . "\n
$text\n
" + . $_; +} + sub do_cmd_seetext{ local($_) = @_; my $content = next_argument(); @@ -1277,8 +1295,7 @@ sub do_cmd_seetext{ # sub do_env_definitions{ - local($_) = @_; - return "
$_
\n"; + return "
" . @_[0] . "
\n"; } sub do_cmd_term{ -- cgit v0.12