[Python-checkins] CVS: python/dist/src/Doc/perl python.perl,1.102,1.103

Fred L. Drake fdrake@users.sourceforge.net
Wed, 20 Jun 2001 14:29:32 -0700


Update of /cvsroot/python/python/dist/src/Doc/perl
In directory usw-pr-cvs1:/tmp/cvs-serv1932/perl

Modified Files:
	python.perl 
Log Message:

Added support for new \setreleaseinfo macro.
Normalize all generated HTML so that attribute names come out as
name="value" instead of name='value'.
Changed the target of RFC links to point to the hypertext RFCs at
www.faqs.org instead of the plain text RFCs at www.ietf.org.


Index: python.perl
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/perl/python.perl,v
retrieving revision 1.102
retrieving revision 1.103
diff -C2 -r1.102 -r1.103
*** python.perl	2001/06/15 21:31:57	1.102
--- python.perl	2001/06/20 21:29:30	1.103
***************
*** 42,54 ****
          # absolute URL; assume it points off-site
          my $icon = make_icon_filename($OFF_SITE_LINK_ICON);
!         return (" <img src='$icon'\n"
!                 . "  border='0' class='offsitelink'"
                  . ($OFF_SITE_LINK_ICON_HEIGHT
!                    ? " height='$OFF_SITE_LINK_ICON_HEIGHT'"
                     : '')
                  . ($OFF_SITE_LINK_ICON_WIDTH
!                    ? " width='$OFF_SITE_LINK_ICON_WIDTH'"
                     : '')
!                 . " alt='[off-site link]'\n"
                  . "  >");
      }
--- 42,54 ----
          # absolute URL; assume it points off-site
          my $icon = make_icon_filename($OFF_SITE_LINK_ICON);
!         return (" <img src=\"$icon\"\n"
!                 . '  border="0" class="offsitelink"'
                  . ($OFF_SITE_LINK_ICON_HEIGHT
!                    ? " height=\"$OFF_SITE_LINK_ICON_HEIGHT\""
                     : '')
                  . ($OFF_SITE_LINK_ICON_WIDTH
!                    ? " width=\"$OFF_SITE_LINK_ICON_WIDTH\""
                     : '')
!                 . " alt=\"[off-site link]\"\n"
                  . "  >");
      }
***************
*** 105,108 ****
--- 105,109 ----
  $DEVELOPER_ADDRESS = '';
  $SHORT_VERSION = '';
+ $RELEASE_INFO = '';
  $PACKAGE_VERSION = '';
  
***************
*** 115,118 ****
--- 116,125 ----
  }
  
+ sub do_cmd_setreleaseinfo{
+     local($_) = @_;
+     $RELEASE_INFO = next_argument();
+     return $_;
+ }
+ 
  sub do_cmd_setshortversion{
      local($_) = @_;
***************
*** 237,241 ****
      $key = $module
          unless $key;
!     return "<tt class='module'><a href='module-$key.html'>$module</a></tt>"
        . $_;
  }
--- 244,248 ----
      $key = $module
          unless $key;
!     return "<tt class=\"module\"><a href=\"module-$key.html\">$module</a></tt>"
        . $_;
  }
***************
*** 245,250 ****
      my $newsgroup = next_argument();
      my $icon = get_link_icon("news:$newsgroup");
!     my $stuff = "<a class='newsgroup' href='news:$newsgroup'>"
!       . "$newsgroup$icon</a>";
      return $stuff . $_;
  }
--- 252,257 ----
      my $newsgroup = next_argument();
      my $icon = get_link_icon("news:$newsgroup");
!     my $stuff = ("<a class=\"newsgroup\" href=\"news:$newsgroup\">"
!                  . "$newsgroup$icon</a>");
      return $stuff . $_;
  }
***************
*** 277,292 ****
      my $page = next_argument();
      my $section = next_argument();
!     return "<span class='manpage'><i>$page</i>($section)</span>" . $_;
  }
  
! $PEP_FORMAT = "http://python.sourceforge.net/peps/pep-XXXX.html";
! $RFC_FORMAT = "http://www.ietf.org/rfc/rfcXXXX.txt";
  
  sub get_rfc_url($$){
      my($rfcnum, $format) = @_;
!     $rfcnum = sprintf("%04d", $rfcnum);
!     $format = "$format";
!     $format =~ s/XXXX/$rfcnum/;
!     return $format;
  }
  
--- 284,297 ----
      my $page = next_argument();
      my $section = next_argument();
!     return "<span class=\"manpage\"><i>$page</i>($section)</span>" . $_;
  }
  
! $PEP_FORMAT = "http://python.sourceforge.net/peps/pep-%04d.html";
! #$RFC_FORMAT = "http://www.ietf.org/rfc/rfc%04d.txt";
! $RFC_FORMAT = "http://www.faqs.org/rfcs/rfc%d.html";
  
  sub get_rfc_url($$){
      my($rfcnum, $format) = @_;
!     return sprintf($format, $rfcnum);
  }
  
***************
*** 324,334 ****
      my $repl = '';
      if ($url) {
!         $repl = ("<em class='citetitle'><a\n"
!                  . " href='$url'\n"
!                  . " title='$title'\n"
                   . " >$title$icon</a></em>");
      }
      else {
!         $repl = "<em class='citetitle'\n >$title</em>";
      }
      return $repl . $_;
--- 329,339 ----
      my $repl = '';
      if ($url) {
!         $repl = ("<em class=\"citetitle\"><a\n"
!                  . " href=\"$url\"\n"
!                  . " title=\"$title\"\n"
                   . " >$title$icon</a></em>");
      }
      else {
!         $repl = "<em class=\"citetitle\"\n >$title</em>";
      }
      return $repl . $_;
***************
*** 356,360 ****
          $text = "$type in version $release:\n$explanation.";
      }
!     return "\n<span class='versionnote'>$text</span>\n" . $_;
  }
  
--- 361,365 ----
          $text = "$type in version $release:\n$explanation.";
      }
!     return "\n<span class=\"versionnote\">$text</span>\n" . $_;
  }
  
***************
*** 373,381 ****
      local($_) = @_;
      my $platform = next_argument();
!     $ModulePlatforms{"<tt class='module'>$THIS_MODULE</tt>"} = $platform;
      $platform = "Macintosh"
        if $platform eq 'Mac';
!     return "\n<p class='availability'>Availability: <span"
!       . "\n class='platform'>$platform</span>.</p>\n" . $_;
  }
  
--- 378,386 ----
      local($_) = @_;
      my $platform = next_argument();
!     $ModulePlatforms{"<tt class=\"module\">$THIS_MODULE</tt>"} = $platform;
      $platform = "Macintosh"
        if $platform eq 'Mac';
!     return "\n<p class=\"availability\">Availability: <span"
!       . "\n class=\"platform\">$platform</span>.</p>\n" . $_;
  }
  
***************
*** 446,450 ****
      my($node,$target) = @_;
      print INTLABELS "\$internal_labels{\"$target\"} = \"$URL/$node\";\n";
!     return "<a href='$node#$target'>";
  }
  
--- 451,455 ----
      my($node,$target) = @_;
      print INTLABELS "\$internal_labels{\"$target\"} = \"$URL/$node\";\n";
!     return "<a href=\"$node#$target\">";
  }
  
***************
*** 459,463 ****
  sub new_link_info{
      my $name = "l2h-" . ++$globals{'max_id'};
!     my $aname = "<a name='$name'>";
      my $ahref = gen_link($CURRENT_FILE, $name);
      return ($name, $aname, $ahref);
--- 464,468 ----
  sub new_link_info{
      my $name = "l2h-" . ++$globals{'max_id'};
!     my $aname = "<a name=\"$name\">";
      my $ahref = gen_link($CURRENT_FILE, $name);
      return ($name, $aname, $ahref);
***************
*** 579,583 ****
  sub idx_cmd_bifuncindex{
      my $str = next_argument();
!     add_index_entry("<tt class='function'>$str()</tt> (built-in function)",
                      @_[0]);
  }
--- 584,588 ----
  sub idx_cmd_bifuncindex{
      my $str = next_argument();
!     add_index_entry("<tt class=\"function\">$str()</tt> (built-in function)",
                      @_[0]);
  }
***************
*** 621,625 ****
      print "[$name]";
      return make_mod_index_entry(
!         "<tt class='module'>$name</tt> (${word}module)", 'DEF');
  }
  
--- 626,630 ----
      print "[$name]";
      return make_mod_index_entry(
!         "<tt class=\"module\">$name</tt> (${word}module)", 'DEF');
  }
  
***************
*** 639,643 ****
      my $str = next_argument();
      $word = "$word " if $word;
!     $str = "<tt class='module'>$str</tt> (${word}module)";
      # can't use add_index_entry() since the 2nd arg to gen_index_id() is used;
      # just inline it all here
--- 644,648 ----
      my $str = next_argument();
      $word = "$word " if $word;
!     $str = "<tt class=\"module\">$str</tt> (${word}module)";
      # can't use add_index_entry() since the 2nd arg to gen_index_id() is used;
      # just inline it all here
***************
*** 713,717 ****
      my $arg_list = next_argument();
      my $idx = make_str_index_entry(
!         "<tt class='cfunction'>$function_name()</tt>" . get_indexsubitem());
      $idx =~ s/ \(.*\)//;
      $idx =~ s/\(\)//;		# ???? - why both of these?
--- 718,722 ----
      my $arg_list = next_argument();
      my $idx = make_str_index_entry(
!         "<tt class=\"cfunction\">$function_name()</tt>" . get_indexsubitem());
      $idx =~ s/ \(.*\)//;
      $idx =~ s/\(\)//;		# ???? - why both of these?
***************
*** 742,746 ****
      local($_) = @_;
      my $name = next_argument();
!     my $idx = make_str_index_entry("<tt class='macro'>$name</tt>");
      return "<dl><dt><b>$idx</b>\n<dd>"
             . $_
--- 747,751 ----
      local($_) = @_;
      my $name = next_argument();
!     my $idx = make_str_index_entry("<tt class=\"macro\">$name</tt>");
      return "<dl><dt><b>$idx</b>\n<dd>"
             . $_
***************
*** 755,760 ****
        unless $index_name;
      my($name,$aname,$ahref) = new_link_info();
!     add_index_entry("<tt class='ctype'>$index_name</tt> (C type)", $ahref);
!     return "<dl><dt><b><tt class='ctype'>$aname$type_name</a></tt></b>\n<dd>"
             . $_
             . '</dl>'
--- 760,765 ----
        unless $index_name;
      my($name,$aname,$ahref) = new_link_info();
!     add_index_entry("<tt class=\"ctype\">$index_name</tt> (C type)", $ahref);
!     return "<dl><dt><b><tt class=\"ctype\">$aname$type_name</a></tt></b>\n<dd>"
             . $_
             . '</dl>'
***************
*** 765,769 ****
      my $var_type = next_argument();
      my $var_name = next_argument();
!     my $idx = make_str_index_entry("<tt class='cdata'>$var_name</tt>"
  				   . get_indexsubitem());
      $idx =~ s/ \(.*\)//;
--- 770,774 ----
      my $var_type = next_argument();
      my $var_name = next_argument();
!     my $idx = make_str_index_entry("<tt class=\"cdata\">$var_name</tt>"
  				   . get_indexsubitem());
      $idx =~ s/ \(.*\)//;
***************
*** 784,788 ****
      my $function_name = next_argument();
      my $arg_list = convert_args(next_argument());
!     my $idx = make_str_index_entry("<tt class='function'>$function_name()</tt>"
  				   . get_indexsubitem());
      $idx =~ s/ \(.*\)//;
--- 789,794 ----
      my $function_name = next_argument();
      my $arg_list = convert_args(next_argument());
!     my $idx = make_str_index_entry("<tt class=\"function\">$function_name()"
!                                    . '</tt>'
  				   . get_indexsubitem());
      $idx =~ s/ \(.*\)//;
***************
*** 795,799 ****
      my $function_name = next_argument();
      my $arg_list = convert_args(next_argument());
!     return "<dl><dt><b><tt class='function'>$function_name</tt></b>"
        . "(<var>$arg_list</var>)\n"
        . '<dd>'
--- 801,805 ----
      my $function_name = next_argument();
      my $arg_list = convert_args(next_argument());
!     return "<dl><dt><b><tt class=\"function\">$function_name</tt></b>"
        . "(<var>$arg_list</var>)\n"
        . '<dd>'
***************
*** 806,810 ****
      my $function_name = next_argument();
      my $arg_list = convert_args(next_argument());
!     my $prefix = "<tt class='function'>$function_name()</tt>";
      my $idx = make_str_index_entry($prefix . get_indexsubitem());
      $prefix =~ s/\(\)//;
--- 812,816 ----
      my $function_name = next_argument();
      my $arg_list = convert_args(next_argument());
!     my $prefix = "<tt class=\"function\">$function_name()</tt>";
      my $idx = make_str_index_entry($prefix . get_indexsubitem());
      $prefix =~ s/\(\)//;
***************
*** 817,821 ****
      my $function_name = next_argument();
      my $arg_list = convert_args(next_argument());
!     my $prefix = "<tt class='function'>$function_name</tt>";
  
      return "<dt><b>$prefix</b>(<var>$arg_list</var>)\n<dd>" . $_;
--- 823,827 ----
      my $function_name = next_argument();
      my $arg_list = convert_args(next_argument());
!     my $prefix = "<tt class=\"function\">$function_name</tt>";
  
      return "<dt><b>$prefix</b>(<var>$arg_list</var>)\n<dd>" . $_;
***************
*** 834,843 ****
      my $idx;
      if ($INDEX_OPCODES) {
! 	$idx = make_str_index_entry("<tt class='opcode'>$opcode_name</tt>"
!                                     . " (byte code instruction)");
  	$idx =~ s/ \(byte code instruction\)//;
      }
      else {
! 	$idx = "<tt class='opcode'>$opcode_name</tt>";
      }
      my $stuff = "<dl><dt><b>$idx</b>";
--- 840,849 ----
      my $idx;
      if ($INDEX_OPCODES) {
! 	$idx = make_str_index_entry("<tt class=\"opcode\">$opcode_name</tt>"
!                                     . ' (byte code instruction)');
  	$idx =~ s/ \(byte code instruction\)//;
      }
      else {
! 	$idx = "<tt class=\"opcode\">$opcode_name</tt>";
      }
      my $stuff = "<dl><dt><b>$idx</b>";
***************
*** 884,888 ****
      local($_) = @_;
      my $excname = next_argument();
!     my $idx = make_str_index_entry("<tt class='exception'>$excname</tt>");
      return "<dl><dt><b>exception $idx</b>\n<dd>" . $_ . '</dl>'
  }
--- 890,894 ----
      local($_) = @_;
      my $excname = next_argument();
!     my $idx = make_str_index_entry("<tt class=\"exception\">$excname</tt>");
      return "<dl><dt><b>exception $idx</b>\n<dd>" . $_ . '</dl>'
  }
***************
*** 896,900 ****
      my $arg_list = convert_args(next_argument());
      $idx = make_str_index_entry(
! 		"<tt class='$what'>$THIS_CLASS</tt> ($what in $THIS_MODULE)" );
      $idx =~ s/ \(.*\)//;
      return ("<dl><dt><b>$what $idx</b>(<var>$arg_list</var>)\n<dd>"
--- 902,906 ----
      my $arg_list = convert_args(next_argument());
      $idx = make_str_index_entry(
! 	"<tt class=\"$what\">$THIS_CLASS</tt> ($what in $THIS_MODULE)" );
      $idx =~ s/ \(.*\)//;
      return ("<dl><dt><b>$what $idx</b>(<var>$arg_list</var>)\n<dd>"
***************
*** 911,915 ****
      $THIS_CLASS = next_argument();
      $idx = make_str_index_entry(
! 		"<tt class='class'>$THIS_CLASS</tt> (class in $THIS_MODULE)" );
      $idx =~ s/ \(.*\)//;
      return ("<dl><dt><b>class $idx</b>\n<dd>"
--- 917,921 ----
      $THIS_CLASS = next_argument();
      $idx = make_str_index_entry(
! 	"<tt class=\"class\">$THIS_CLASS</tt> (class in $THIS_MODULE)");
      $idx =~ s/ \(.*\)//;
      return ("<dl><dt><b>class $idx</b>\n<dd>"
***************
*** 934,938 ****
  	$extra = " ($class_name method)";
      }
!     my $idx = make_str_index_entry("<tt class='method'>$method()</tt>$extra");
      $idx =~ s/ \(.*\)//;
      $idx =~ s/\(\)//;
--- 940,945 ----
  	$extra = " ($class_name method)";
      }
!     my $idx = make_str_index_entry(
!         "<tt class=\"method\">$method()</tt>$extra");
      $idx =~ s/ \(.*\)//;
      $idx =~ s/\(\)//;
***************
*** 952,956 ****
  	$extra = " ($class_name method)";
      }
!     my $idx = make_str_index_entry("<tt class='method'>$method()</tt>$extra");
      $idx =~ s/ \(.*\)//;
      $idx =~ s/\(\)//;
--- 959,964 ----
  	$extra = " ($class_name method)";
      }
!     my $idx = make_str_index_entry(
!         "<tt class=\"method\">$method()</tt>$extra");
      $idx =~ s/ \(.*\)//;
      $idx =~ s/\(\)//;
***************
*** 989,993 ****
      $extra = " ($class attribute)"
          if ($class ne '');
!     my $idx = make_str_index_entry("<tt class='member'>$member</tt>$extra");
      $idx =~ s/ \(.*\)//;
      $idx =~ s/\(\)//;
--- 997,1001 ----
      $extra = " ($class attribute)"
          if ($class ne '');
!     my $idx = make_str_index_entry("<tt class=\"member\">$member</tt>$extra");
      $idx =~ s/ \(.*\)//;
      $idx =~ s/\(\)//;
***************
*** 1005,1009 ****
      $extra = " ($class attribute)"
          if ($class ne '');
!     my $idx = make_str_index_entry("<tt class='member'>$member</tt>$extra");
      $idx =~ s/ \(.*\)//;
      $idx =~ s/\(\)//;
--- 1013,1017 ----
      $extra = " ($class attribute)"
          if ($class ne '');
!     my $idx = make_str_index_entry("<tt class=\"member\">$member</tt>$extra");
      $idx =~ s/ \(.*\)//;
      $idx =~ s/\(\)//;
***************
*** 1015,1019 ****
      next_optional_argument();
      my $member = next_argument();
!     return "<dl><dt><b><tt class='member'>$member</tt></b>\n<dd>"
             . $_
             . '</dl>';
--- 1023,1027 ----
      next_optional_argument();
      my $member = next_argument();
!     return "<dl><dt><b><tt class=\"member\">$member</tt></b>\n<dd>"
             . $_
             . '</dl>';
***************
*** 1025,1029 ****
      next_optional_argument();
      my $member = next_argument();
!     return "<dt><b><tt class='member'>$member</tt></b><dd>" . $_;
  }
  
--- 1033,1037 ----
      next_optional_argument();
      my $member = next_argument();
!     return "<dt><b><tt class=\"member\">$member</tt></b><dd>" . $_;
  }
  
***************
*** 1120,1124 ****
  	   . "\n      </tr>"
  	   . "\n    </thead>"
! 	   . "\n  <tbody valign='baseline'>"
  	   . $_
  	   . "\n    </tbody>"
--- 1128,1132 ----
  	   . "\n      </tr>"
  	   . "\n    </thead>"
! 	   . "\n  <tbody valign=\"baseline\">"
  	   . $_
  	   . "\n    </tbody>"
***************
*** 1169,1173 ****
  	   . "\n      </tr>"
  	   . "\n    </thead>"
! 	   . "\n  <tbody valign='baseline'>"
  	   . $_
  	   . "\n    </tbody>"
--- 1177,1181 ----
  	   . "\n      </tr>"
  	   . "\n    </thead>"
! 	   . "\n  <tbody valign=\"baseline\">"
  	   . $_
  	   . "\n    </tbody>"
***************
*** 1223,1227 ****
  	   . "\n      </tr>"
  	   . "\n    </thead>"
! 	   . "\n  <tbody valign='baseline'>"
  	   . $_
  	   . "\n    </tbody>"
--- 1231,1235 ----
  	   . "\n      </tr>"
  	   . "\n    </thead>"
! 	   . "\n  <tbody valign=\"baseline\">"
  	   . $_
  	   . "\n    </tbody>"
***************
*** 1286,1294 ****
  	    my $href = translate_commands($t_authorURL);
  	    $href = make_named_href('author', $href,
! 				    "<b><font size='+2'>$t_author</font></b>");
  	    $the_title .= "\n<p>$href</p>";
  	}
          else {
! 	    $the_title .= ("\n<p><b><font size='+2'>$t_author</font></b></p>");
  	}
      }
--- 1294,1304 ----
  	    my $href = translate_commands($t_authorURL);
  	    $href = make_named_href('author', $href,
! 				    "<b><font size=\"+2\">$t_author"
!                                     . '</font></b>');
  	    $the_title .= "\n<p>$href</p>";
  	}
          else {
! 	    $the_title .= ("\n<p><b><font size=\"+2\">$t_author"
!                            . '</font></b></p>');
  	}
      }
***************
*** 1308,1312 ****
  	$the_title .= "\n<p>";
  	if ($PACKAGE_VERSION) {
! 	    $the_title .= "<strong>Release $PACKAGE_VERSION</strong><br>\n";
          }
  	$the_title .= "<strong>$t_date</strong></p>"
--- 1318,1323 ----
  	$the_title .= "\n<p>";
  	if ($PACKAGE_VERSION) {
! 	    $the_title .= ('<strong>Release '
!                            . "$PACKAGE_VERSION$RELEASE_INFO</strong><br>\n");
          }
  	$the_title .= "<strong>$t_date</strong></p>"
***************
*** 1485,1492 ****
  
  sub do_env_seealso{
!     return "<div class='seealso'>\n  "
!       . "<p class='heading'><b>See Also:</b></p>\n"
!       . @_[0]
!       . '</div>';
  }
  
--- 1496,1503 ----
  
  sub do_env_seealso{
!     return ("<div class=\"seealso\">\n  "
!             . "<p class=\"heading\"><b>See Also:</b></p>\n"
!             . @_[0]
!             . '</div>');
  }
  
***************
*** 1504,1512 ****
  	$period = '';
      }
!     return '<dl compact class="seemodule">'
!       . "\n    <dt>Module <b><tt class='module'><a href='module-$key.html'>"
!       . "$module</a></tt>:</b>"
!       . "\n    <dd>$text$period\n  </dl>"
!       . $_;
  }
  
--- 1515,1523 ----
  	$period = '';
      }
!     return ('<dl compact class="seemodule">'
!             . "\n    <dt>Module <b><tt class=\"module\">"
!             . "<a href=\"module-$key.html\">$module</a></tt>:</b>"
!             . "\n    <dd>$text$period\n  </dl>"
!             . $_);
  }
  
***************
*** 1587,1591 ****
  
  sub do_env_definitions{
!     return "<dl class='definitions'>" . @_[0] . "</dl>\n";
  }
  
--- 1598,1602 ----
  
  sub do_env_definitions{
!     return "<dl class=\"definitions\">" . @_[0] . "</dl>\n";
  }