Mercurial > cpython-lru_cache-weakref
diff Doc/perl/python.perl @ 12499:0780aba97898 legacy-trunk
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".
| author | Fred Drake <fdrake@acm.org> |
|---|---|
| date | Wed, 26 Apr 2000 18:05:24 +0000 |
| parents | 6ce6c23acd14 |
| children | bef675dc11cc |
line wrap: on
line diff
--- a/Doc/perl/python.perl Wed Apr 26 02:38:01 2000 +0000 +++ b/Doc/perl/python.perl Wed Apr 26 18:05:24 2000 +0000 @@ -229,12 +229,16 @@ 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_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_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_env_definitions{ - local($_) = @_; - return "<dl class='definitions'>$_</dl>\n"; + return "<dl class='definitions'>" . @_[0] . "</dl>\n"; } sub do_cmd_term{
