15
15
from docutils import nodes , utils
16
16
from docutils .parsers .rst import Directive
17
17
18
+ from sphinx .util import status_iterator
18
19
from sphinx .util .nodes import split_explicit_title
19
20
from sphinx .writers .html import HTMLTranslator
20
21
from sphinx .writers .latex import LaTeXTranslator
22
+ from sphinx .writers .text import TextTranslator
21
23
22
24
# monkey-patch reST parser to disable alphabetic and roman enumerated lists
23
25
from docutils .parsers .rst .states import Body
@@ -158,8 +160,11 @@ def run(self):
158
160
class PydocTopicsBuilder (Builder ):
159
161
name = 'pydoc-topics'
160
162
163
+ default_translator_class = TextTranslator
164
+
161
165
def init (self ):
162
166
self .topics = {}
167
+ self .secnumbers = {}
163
168
164
169
def get_outdated_docs (self ):
165
170
return 'all pydoc topics'
@@ -169,9 +174,9 @@ def get_target_uri(self, docname, typ=None):
169
174
170
175
def write (self , * ignored ):
171
176
writer = TextWriter (self )
172
- for label in self . status_iterator (pydoc_topic_labels ,
173
- 'building topics... ' ,
174
- length = len (pydoc_topic_labels )):
177
+ for label in status_iterator (pydoc_topic_labels ,
178
+ 'building topics... ' ,
179
+ length = len (pydoc_topic_labels )):
175
180
if label not in self .env .domaindata ['std' ]['labels' ]:
176
181
self .warn ('label %r not in documentation' % label )
177
182
continue
0 commit comments