]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add support for the classdesc* environment and the \releaseinfo and
authorFred Drake <fdrake@acm.org>
Fri, 22 Jun 2001 15:51:28 +0000 (15:51 +0000)
committerFred Drake <fdrake@acm.org>
Fri, 22 Jun 2001 15:51:28 +0000 (15:51 +0000)
\setreleaseinfo macros added to the CVS head.

Doc/perl/l2hinit.perl
Doc/perl/python.perl
Doc/texinputs/python.sty

index d3720d999747cbfc16ff87236b902cdf7857aa6d..7ef9ad63d9ddab85ff307ea248c56ec320225dd7 100644 (file)
@@ -181,12 +181,12 @@ sub make_nav_panel {
 sub get_version_text {
     if ($PACKAGE_VERSION ne '' && $t_date) {
         return ("<span class=\"release-info\">"
-                . "Release $PACKAGE_VERSION,"
+                . "Release $PACKAGE_VERSION$RELEASE_INFO,"
                 . " documentation updated on $t_date.</span>");
     }
     if ($PACKAGE_VERSION ne '') {
         return ("<span class=\"release-info\">"
-                . "Release $PACKAGE_VERSION.</span>");
+                . "Release $PACKAGE_VERSION$RELEASE_INFO.</span>");
     }
     if ($t_date) {
         return ("<span class=\"release-info\">Documentation released on "
@@ -415,7 +415,7 @@ sub do_cmd_textohtmlinfopage {
     if ($t_date) {                                     # mostly ours
        $the_version = ",\n$t_date";
        if ($PACKAGE_VERSION) {
-           $the_version .= ", Release $PACKAGE_VERSION";
+           $the_version .= ", Release $PACKAGE_VERSION$RELEASE_INFO";
        }
     }
     $_ = (($INFO == 1)
index 7b58d6a0de1ff5ef9fcb77d1baceb8c84a9430da..1e54ae9f9d42e734755c896685da14e2a504c7b2 100644 (file)
@@ -104,6 +104,7 @@ sub do_cmd_e{ '&#92;' . @_[0]; }
 
 $DEVELOPER_ADDRESS = '';
 $SHORT_VERSION = '';
+$RELEASE_INFO = '';
 $PACKAGE_VERSION = '';
 
 sub do_cmd_version{ $PACKAGE_VERSION . @_[0]; }
@@ -114,6 +115,12 @@ sub do_cmd_release{
     return $_;
 }
 
+sub do_cmd_setreleaseinfo{
+    local($_) = @_;
+    $RELEASE_INFO = next_argument();
+    return $_;
+}
+
 sub do_cmd_setshortversion{
     local($_) = @_;
     $SHORT_VERSION = next_argument();
@@ -906,6 +913,17 @@ sub do_env_classdesc{
     return handle_classlike_descriptor(@_[0], "class");
 }
 
+sub do_env_classdescstar{
+    local($_) = @_;
+    $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>"
+            . $_
+            . '</dl>');
+}
+
 sub do_env_excclassdesc{
     return handle_classlike_descriptor(@_[0], "exception");
 }
@@ -1296,7 +1314,8 @@ sub make_my_titlepage() {
     if ($t_date) {
        $the_title .= "\n<p>";
        if ($PACKAGE_VERSION) {
-           $the_title .= "<strong>Release $PACKAGE_VERSION</strong><br>\n";
+           $the_title .= ('<strong>Release '
+                           . "$PACKAGE_VERSION$RELEASE_INFO</strong><br>\n");
         }
        $the_title .= "<strong>$t_date</strong></p>"
     }
index 795882d64da13ca33f58b79f0fa372e4f503eee1..e4c60b834b14abeaca76a448fa7e0191d3647bcf 100644 (file)
       \index{#1@{\py@idxcode{#1}} (class in \py@thismodule)}]
 }{\end{fulllineitems}}
 
+% \begin{classdesc*}{name}
+\newenvironment{classdesc*}[1]{
+  % Using \renewcommand doesn't work for this, for unknown reasons:
+  \global\def\py@thisclass{#1}
+  \begin{fulllineitems}
+    \item[\strong{class }\code{\bfcode{#1}}%
+      \index{#1@{\py@idxcode{#1}} (class in \py@thismodule)}]
+}{\end{fulllineitems}}
+
 % \begin{excclassdesc}{name}{constructor args}
 % but indexes as an exception
 \newenvironment{excclassdesc}[2]{
       \index{#1@{\py@idxcode{#1}} (exception in \py@thismodule)}]
 }{\end{fulllineitems}}
 
+% There is no corresponding {excclassdesc*} environment.  To describe
+% a class exception without parameters, use the {excdesc} environment.
+
 
 \let\py@classbadkey=\@undefined
 
 \newcommand{\py@release}{}
 \newcommand{\version}{}
 \newcommand{\shortversion}{}
+\newcommand{\releaseinfo}{}
 \newcommand{\releasename}{Release}
 \newcommand{\release}[1]{%
   \renewcommand{\py@release}{\releasename\space\version}%
   \renewcommand{\version}{#1}}
 \newcommand{\setshortversion}[1]{%
   \renewcommand{\shortversion}{#1}}
+\newcommand{\setreleaseinfo}[1]{%
+  \renewcommand{\releaseinfo}{#1}}
 
 % Allow specification of the author's address separately from the
 % author's name.  This can be used to format them differently, which