[Python-checkins] CVS: python/dist/src/Doc/perl python.perl,1.93,1.94

Fred L. Drake fdrake@users.sourceforge.net
Mon, 22 Jan 2001 09:33:26 -0800


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

Modified Files:
	python.perl 
Log Message:

Fix \seepep handling -- correct URL to the online PEP repository on SF is
now generated.  (SF bug #129692.)

Patch from Anthon van der Neut <anthon@mnt.org>:
Work around the removal of content-less paired tags used for name
anchors in some places.  (SF bug #116008.)

Move some class attributes from an artificial SPAN element to otherwise
"useful" elements that are being generated anyway.  Added the class
"versionnote", used for \deprecated, \versionadded, \versionchanged.


Index: python.perl
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/perl/python.perl,v
retrieving revision 1.93
retrieving revision 1.94
diff -C2 -r1.93 -r1.94
*** python.perl	2000/12/14 18:36:12	1.93
--- python.perl	2001/01/22 17:33:24	1.94
***************
*** 244,249 ****
      my $newsgroup = next_argument();
      my $icon = get_link_icon("news:$newsgroup");
!     my $stuff = "<span class='newsgroup'><a href='news:$newsgroup'>"
!       . "$newsgroup$icon</a></span>";
      return $stuff . $_;
  }
--- 244,249 ----
      my $newsgroup = next_argument();
      my $icon = get_link_icon("news:$newsgroup");
!     my $stuff = "<a class='newsgroup' href='news:$newsgroup'>"
!       . "$newsgroup$icon</a>";
      return $stuff . $_;
  }
***************
*** 255,263 ****
      # The <tt> here is really to keep buildindex.py from making
      # the variable name case-insensitive.
!     add_index_entry("environment variables!$envvar@<tt>\$$envvar</tt>",
  		    $ahref);
!     add_index_entry("$envvar@\$$envvar", $ahref);
      $aname =~ s/<a/<a class="envvar"/;
!     return "$aname\$$envvar</a>" . $_;
  }
  
--- 255,263 ----
      # The <tt> here is really to keep buildindex.py from making
      # the variable name case-insensitive.
!     add_index_entry("environment variables!$envvar@<tt>$envvar</tt>",
  		    $ahref);
!     add_index_entry("$envvar (environment variable)", $ahref);
      $aname =~ s/<a/<a class="envvar"/;
!     return "$aname$envvar</a>" . $_;
  }
  
***************
*** 279,285 ****
  }
  
! sub get_pep_url{
!     my $rfcnum = sprintf("%04d", @_[0]);
!     return "http://python.sourceforge.net/peps/pep-$rfcnum.html";
  }
  
--- 279,291 ----
  }
  
! $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;
  }
  
***************
*** 288,292 ****
      my $rfcnumber = next_argument();
      my $id = "rfcref-" . ++$global{'max_id'};
!     my $href = get_pep_url($rfcnumber);
      my $icon = get_link_icon($href);
      # Save the reference
--- 294,298 ----
      my $rfcnumber = next_argument();
      my $id = "rfcref-" . ++$global{'max_id'};
!     my $href = get_rfc_url($rfcnumber, $PEP_FORMAT);
      my $icon = get_link_icon($href);
      # Save the reference
***************
*** 297,310 ****
  }
  
- 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);
      my $icon = get_link_icon($href);
      # Save the reference
--- 303,311 ----
  }
  
  sub do_cmd_rfc{
      local($_) = @_;
      my $rfcnumber = next_argument();
      my $id = "rfcref-" . ++$global{'max_id'};
!     my $href = get_rfc_url($rfcnumber, $RFC_FORMAT);
      my $icon = get_link_icon($href);
      # Save the reference
***************
*** 338,342 ****
      my $release = next_argument();
      my $reason = next_argument();
!     return "<b>Deprecated since release $release.</b>\n$reason<p>" . $_;
  }
  
--- 339,346 ----
      my $release = next_argument();
      my $reason = next_argument();
!     return ('<div class="versionnote">'
!             . "<b>Deprecated since release $release.</b>"
!             . "\n$reason</div><p>"
!             . $_);
  }
  
***************
*** 345,349 ****
      local($_) = @_;
      my $release = next_argument();
!     return "\nNew in version $release.\n" . $_;
  }
  
--- 349,354 ----
      local($_) = @_;
      my $release = next_argument();
!     return ("\n<span class='versionnote'>New in version $release.</span>\n"
!             . $_);
  }
  
***************
*** 353,361 ****
      my $explanation = next_optional_argument();
      my $release = next_argument();
!     my $text = "\nChanged in version $release.\n";
!     if ($release) {
!         $text = "\nChanged in version $release:\n$explanation.\n";
      }
!     return $text . $_;
  }
  
--- 358,366 ----
      my $explanation = next_optional_argument();
      my $release = next_argument();
!     my $text = "Changed in version $release.";
!     if ($explanation) {
!         $text = "Changed in version $release:\n$explanation.";
      }
!     return "\n<span class='versionnote'>$text</span>\n" . $_;
  }
  
***************
*** 500,503 ****
--- 505,511 ----
  	}
      }
+     if (/^[ \t\r\n]/) {
+         $_ = substr($_, 1);
+     }
      return "$aname$anchor_invisible_mark</a>" . $_;
  }
***************
*** 590,594 ****
  	$Modules{$nstr} .= $ahref;
      }
!     return "$aname$anchor_invisible_mark</a>";
  }
  
--- 598,602 ----
  	$Modules{$nstr} .= $ahref;
      }
!     return "$aname$anchor_invisible_mark2</a>";
  }
  
***************
*** 648,652 ****
  
  sub init_myformat{
!     $anchor_invisible_mark = '';
      $anchor_mark = '';
      $icons{'anchor_mark'} = '';
--- 656,661 ----
  
  sub init_myformat{
!     $anchor_invisible_mark = '&nbsp;';
!     $anchor_invisible_mark2 = '';
      $anchor_mark = '';
      $icons{'anchor_mark'} = '';
***************
*** 1031,1034 ****
--- 1040,1046 ----
          $font = 'b';
      }
+     elsif ($font eq 'exception') {
+         $font = 'tt class="exception"';
+     }
      return $font;
  }
***************
*** 1485,1493 ****
  
  sub handle_rfclike_reference{
!     local($_, $what) = @_;
      my $rfcnum = next_argument();
      my $title = next_argument();
      my $text = next_argument();
!     my $url = get_rfc_url($rfcnum);
      my $icon = get_link_icon($url);
      return '<dl compact class="seerfc">'
--- 1497,1505 ----
  
  sub handle_rfclike_reference{
!     local($_, $what, $format) = @_;
      my $rfcnum = next_argument();
      my $title = next_argument();
      my $text = next_argument();
!     my $url = get_rfc_url($rfcnum, $format);
      my $icon = get_link_icon($url);
      return '<dl compact class="seerfc">'
***************
*** 1500,1508 ****
  
  sub do_cmd_seepep{
!     return handle_rfclike_reference(@_[0], "PEP");
  }
  
  sub do_cmd_seerfc{
!     return handle_rfclike_reference(@_[0], "RFC");
  }
  
--- 1512,1520 ----
  
  sub do_cmd_seepep{
!     return handle_rfclike_reference(@_[0], "PEP", $PEP_FORMAT);
  }
  
  sub do_cmd_seerfc{
!     return handle_rfclike_reference(@_[0], "RFC", $RFC_FORMAT);
  }