[Python-checkins] CVS: python/dist/src/Doc/perl python.perl,1.72,1.73
Fred Drake
python-dev@python.org
Wed, 26 Apr 2000 14:05:27 -0400
Update of /projects/cvsroot/python/dist/src/Doc/perl
In directory seahag.cnri.reston.va.us:/home/fdrake/projects/python/Doc/perl
Modified Files:
python.perl
Log Message:
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".
Index: python.perl
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Doc/perl/python.perl,v
retrieving revision 1.72
retrieving revision 1.73
diff -C2 -r1.72 -r1.73
*** python.perl 2000/04/11 18:46:59 1.72
--- python.perl 2000/04/26 18:05:24 1.73
***************
*** 230,239 ****
}
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";
# Save the reference
my $nstr = gen_index_id("RFC!RFC $rfcnumber", '');
--- 230,243 ----
}
+ 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 = get_rfc_url($rfcnumber);
# Save the reference
my $nstr = gen_index_id("RFC!RFC $rfcnumber", '');
***************
*** 548,552 ****
sub ref_module_index_helper{
! local($word, $ahref) = @_;
my $str = next_argument();
$word = "$word " if $word;
--- 552,556 ----
sub ref_module_index_helper{
! my($word, $ahref) = @_;
my $str = next_argument();
$word = "$word " if $word;
***************
*** 1266,1269 ****
--- 1270,1287 ----
}
+ 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($_) = @_;
***************
*** 1278,1283 ****
sub do_env_definitions{
! local($_) = @_;
! return "<dl class='definitions'>$_</dl>\n";
}
--- 1296,1300 ----
sub do_env_definitions{
! return "<dl class='definitions'>" . @_[0] . "</dl>\n";
}