Commit 37cc0c0e authored by Fred Drake's avatar Fred Drake

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".
parent ff2d9b71
...@@ -229,12 +229,16 @@ sub do_cmd_manpage{ ...@@ -229,12 +229,16 @@ sub do_cmd_manpage{
return "<span class='manpage'><i>$page</i>($section)</span>" . $_; 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{ sub do_cmd_rfc{
local($_) = @_; local($_) = @_;
my $rfcnumber = next_argument(); my $rfcnumber = next_argument();
my $id = "rfcref-" . ++$global{'max_id'}; my $id = "rfcref-" . ++$global{'max_id'};
my $href = my $href = get_rfc_url($rfcnumber);
"http://info.internet.isi.edu/in-notes/rfc/files/rfc$rfcnumber.txt";
# Save the reference # Save the reference
my $nstr = gen_index_id("RFC!RFC $rfcnumber", ''); my $nstr = gen_index_id("RFC!RFC $rfcnumber", '');
$index{$nstr} .= make_half_href("$CURRENT_FILE#$id"); $index{$nstr} .= make_half_href("$CURRENT_FILE#$id");
...@@ -547,7 +551,7 @@ sub do_cmd_exmodindex{ return my_module_index_helper('extension', @_); } ...@@ -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 do_cmd_stmodindex{ return my_module_index_helper('standard', @_); }
sub ref_module_index_helper{ sub ref_module_index_helper{
local($word, $ahref) = @_; my($word, $ahref) = @_;
my $str = next_argument(); my $str = next_argument();
$word = "$word " if $word; $word = "$word " if $word;
$str = "<tt class='module'>$str</tt> (${word}module)"; $str = "<tt class='module'>$str</tt> (${word}module)";
...@@ -1265,6 +1269,20 @@ sub do_cmd_seemodule{ ...@@ -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{ sub do_cmd_seetext{
local($_) = @_; local($_) = @_;
my $content = next_argument(); my $content = next_argument();
...@@ -1277,8 +1295,7 @@ sub do_cmd_seetext{ ...@@ -1277,8 +1295,7 @@ sub do_cmd_seetext{
# #
sub do_env_definitions{ sub do_env_definitions{
local($_) = @_; return "<dl class='definitions'>" . @_[0] . "</dl>\n";
return "<dl class='definitions'>$_</dl>\n";
} }
sub do_cmd_term{ sub do_cmd_term{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment