]> granicus.if.org Git - python/commitdiff
Define a new environment, classdesc*, which can be used to document a
authorFred Drake <fdrake@acm.org>
Fri, 11 May 2001 01:00:30 +0000 (01:00 +0000)
committerFred Drake <fdrake@acm.org>
Fri, 11 May 2001 01:00:30 +0000 (01:00 +0000)
class without providing any information about the constructor.  This
should be used for classes which only exist to act as containers rather
than as factories for instances.

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

index 7b58d6a0de1ff5ef9fcb77d1baceb8c84a9430da..39c99317e059b6f80efc31668f7132508b122597 100644 (file)
@@ -906,6 +906,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");
 }
index 795882d64da13ca33f58b79f0fa372e4f503eee1..35f7727959c08d0eab0c6d042c71fdabc6ad8571 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