[Python-checkins] r66930 - in doctools/trunk: CHANGES sphinx/latexwriter.py sphinx/texinputs/sphinx.sty

georg.brandl python-checkins at python.org
Thu Oct 16 22:33:59 CEST 2008


Author: georg.brandl
Date: Thu Oct 16 22:33:59 2008
New Revision: 66930

Log:
Remove the "ni" environments; they are useless now that index
entries are always inserted separately. Fixes #4132.


Modified:
   doctools/trunk/CHANGES
   doctools/trunk/sphinx/latexwriter.py
   doctools/trunk/sphinx/texinputs/sphinx.sty

Modified: doctools/trunk/CHANGES
==============================================================================
--- doctools/trunk/CHANGES	(original)
+++ doctools/trunk/CHANGES	Thu Oct 16 22:33:59 2008
@@ -116,6 +116,8 @@
 
 * Properly escape quotes in HTML help attribute values.
 
+* Fix LaTeX build for some description environments with ``:noindex:``.
+
 
 Release 0.4.3 (Oct 8, 2008)
 ===========================

Modified: doctools/trunk/sphinx/latexwriter.py
==============================================================================
--- doctools/trunk/sphinx/latexwriter.py	(original)
+++ doctools/trunk/sphinx/latexwriter.py	Thu Oct 16 22:33:59 2008
@@ -106,7 +106,6 @@
 class Desc(object):
     def __init__(self, node):
         self.env = LaTeXTranslator.desc_map.get(node['desctype'], 'describe')
-        self.ni = node['noindex']
         self.type = self.cls = self.name = self.params = self.annotation = ''
         self.count = 0
 
@@ -382,7 +381,7 @@
         self.descstack.append(Desc(node))
     def depart_desc(self, node):
         d = self.descstack.pop()
-        self.body.append("\\end{%s%s}\n" % (d.env, d.ni and 'ni' or ''))
+        self.body.append("\\end{%s}\n" % d.env)
 
     def visit_desc_signature(self, node):
         d = self.descstack[-1]
@@ -396,13 +395,13 @@
         else:
             hyper = ''
         if d.count == 0:
-            t1 = "\n\n%s\\begin{%s%s}" % (hyper, d.env, (d.ni and 'ni' or ''))
+            t1 = "\n\n%s\\begin{%s}" % (hyper, d.env)
         else:
-            t1 = "\n%s\\%sline%s" % (hyper, d.env[:-4], (d.ni and 'ni' or ''))
+            t1 = "\n%s\\%sline" % (hyper, d.env[:-4])
         d.count += 1
         if d.env in ('funcdesc', 'classdesc', 'excclassdesc'):
             t2 = "{%s}{%s}" % (d.name, d.params)
-        elif d.env in ('datadesc', 'classdesc*', 'excdesc', 'csimplemacrodesc'):
+        elif d.env in ('datadesc', 'excdesc', 'csimplemacrodesc'):
             t2 = "{%s}" % (d.name)
         elif d.env in ('methoddesc', 'staticmethoddesc'):
             if d.cls:

Modified: doctools/trunk/sphinx/texinputs/sphinx.sty
==============================================================================
--- doctools/trunk/sphinx/texinputs/sphinx.sty	(original)
+++ doctools/trunk/sphinx/texinputs/sphinx.sty	Thu Oct 16 22:33:59 2008
@@ -414,20 +414,12 @@
 % simple functions (not methods) -----------------------------------------
 % \begin{funcdesc}{name}{args}
 \newcommand{\funcline}[2]{%
-  \funclineni{#1}{#2}}
+  \py at sigline{\bfcode{#1}}{#2}}
 \newenvironment{funcdesc}[2]{
   \begin{fulllineitems}
     \funcline{#1}{#2}
 }{\end{fulllineitems}}
 
-% similar to {funcdesc}, but doesn't add to the index
-\newcommand{\funclineni}[2]{%
-  \py at sigline{\bfcode{#1}}{#2}}
-\newenvironment{funcdescni}[2]{
-  \begin{fulllineitems}
-    \funclineni{#1}{#2}
-}{\end{fulllineitems}}
-
 % classes ----------------------------------------------------------------
 % \begin{classdesc}{name}{constructor args}
 \newcommand{\classline}[2]{
@@ -439,23 +431,6 @@
     \classline{#1}{#2}
 }{\end{fulllineitems}}
 
-\newcommand{\classlineni}[2]{
-  \py at sigline{\strong{class }\bfcode{#1}}{#2}}
-\newenvironment{classdescni}[2]{
-  % Using \renewcommand doesn't work for this, for unknown reasons:
-  \global\def\py at thisclass{#1}
-  \begin{fulllineitems}
-    \classlineni{#1}{#2}
-}{\end{fulllineitems}}
-
-% \begin{classdesc*}{name}
-\newenvironment{classdesc*}[1]{
-  % Using \renewcommand doesn't work for this, for unknown reasons:
-  \global\def\py at thisclass{#1}
-  \begin{fulllineitems}
-    \item[\strong{class }\code{\bfcode{#1}}]
-}{\end{fulllineitems}}
-
 % \begin{excclassdesc}{name}{constructor args}
 % but indexes as an exception
 \newenvironment{excclassdesc}[2]{
@@ -474,8 +449,7 @@
 % object method ----------------------------------------------------------
 % \begin{methoddesc}[classname]{methodname}{args}
 \newcommand{\methodline}[3][\@undefined]{
-  \methodlineni{#2}{#3}
-}
+  \py at sigline{\bfcode{#2}}{#3}}
 \newenvironment{methoddesc}[3][\@undefined]{
   \begin{fulllineitems}
     \ifx\@undefined#1\relax
@@ -486,20 +460,10 @@
     \fi
 }{\end{fulllineitems}}
 
-% similar to {methoddesc}, but doesn't add to the index
-% (never actually uses the optional argument)
-\newcommand{\methodlineni}[3][\py at classbadkey]{%
-  \py at sigline{\bfcode{#2}}{#3}}
-\newenvironment{methoddescni}[3][\py at classbadkey]{
-  \begin{fulllineitems}
-    \methodlineni{#2}{#3}
-}{\end{fulllineitems}}
-
 % static method ----------------------------------------------------------
 % \begin{staticmethoddesc}[classname]{methodname}{args}
 \newcommand{\staticmethodline}[3][\@undefined]{
-  \staticmethodlineni{#2}{#3}
-}
+  \py at sigline{static \bfcode{#2}}{#3}}
 \newenvironment{staticmethoddesc}[3][\@undefined]{
   \begin{fulllineitems}
     \ifx\@undefined#1\relax
@@ -510,22 +474,13 @@
     \fi
 }{\end{fulllineitems}}
 
-% similar to {staticmethoddesc}, but doesn't add to the index
-% (never actually uses the optional argument)
-\newcommand{\staticmethodlineni}[3][\py at classbadkey]{%
-  \py at sigline{static \bfcode{#2}}{#3}}
-\newenvironment{staticmethoddescni}[3][\py at classbadkey]{
-  \begin{fulllineitems}
-    \staticmethodlineni{#2}{#3}
-}{\end{fulllineitems}}
-
 % object data attribute --------------------------------------------------
 % \begin{memberdesc}[classname]{membername}
 \newcommand{\memberline}[2][\py at classbadkey]{%
   \ifx\@undefined#1\relax
-    \memberlineni{#2}
+    \item[\bfcode{#2}]
   \else
-    \memberlineni{#2}
+    \item[\bfcode{#2}]
   \fi
 }
 \newenvironment{memberdesc}[2][\py at classbadkey]{
@@ -538,14 +493,6 @@
     \fi
 }{\end{fulllineitems}}
 
-% similar to {memberdesc}, but doesn't add to the index
-% (never actually uses the optional argument)
-\newcommand{\memberlineni}[2][\py at classbadkey]{\item[\bfcode{#2}]}
-\newenvironment{memberdescni}[2][\py at classbadkey]{
-  \begin{fulllineitems}
-    \memberlineni{#2}
-}{\end{fulllineitems}}
-
 % For exceptions: --------------------------------------------------------
 % \begin{excdesc}{name}
 %  -- for constructor information, use excclassdesc instead
@@ -557,19 +504,12 @@
 % Module data or constants: ----------------------------------------------
 % \begin{datadesc}{name}
 \newcommand{\dataline}[1]{%
-  \datalineni{#1}}
+  \item[\bfcode{#1}]\nopagebreak}
 \newenvironment{datadesc}[1]{
   \begin{fulllineitems}
     \dataline{#1}
 }{\end{fulllineitems}}
 
-% similar to {datadesc}, but doesn't add to the index
-\newcommand{\datalineni}[1]{\item[\bfcode{#1}]\nopagebreak}
-\newenvironment{datadescni}[1]{
-  \begin{fulllineitems}
-    \datalineni{#1}
-}{\end{fulllineitems}}
-
 % bytecode instruction ---------------------------------------------------
 % \begin{opcodedesc}{name}{var}
 % -- {var} may be {}


More information about the Python-checkins mailing list