23
23
from sphinx import addnodes
24
24
from sphinx .builders import Builder
25
25
from sphinx .locale import translators
26
+ from sphinx .util import status_iterator
26
27
from sphinx .util .nodes import split_explicit_title
27
28
from sphinx .writers .html import HTMLTranslator
28
- from sphinx .writers .text import TextWriter
29
+ from sphinx .writers .text import TextWriter , TextTranslator
29
30
from sphinx .writers .latex import LaTeXTranslator
30
31
from sphinx .domains .python import PyModulelevel , PyClassmember
31
32
@@ -295,8 +296,11 @@ def run(self):
295
296
class PydocTopicsBuilder (Builder ):
296
297
name = 'pydoc-topics'
297
298
299
+ default_translator_class = TextTranslator
300
+
298
301
def init (self ):
299
302
self .topics = {}
303
+ self .secnumbers = {}
300
304
301
305
def get_outdated_docs (self ):
302
306
return 'all pydoc topics'
@@ -306,9 +310,9 @@ def get_target_uri(self, docname, typ=None):
306
310
307
311
def write (self , * ignored ):
308
312
writer = TextWriter (self )
309
- for label in self . status_iterator (pydoc_topic_labels ,
310
- 'building topics... ' ,
311
- length = len (pydoc_topic_labels )):
313
+ for label in status_iterator (pydoc_topic_labels ,
314
+ 'building topics... ' ,
315
+ length = len (pydoc_topic_labels )):
312
316
if label not in self .env .domaindata ['std' ]['labels' ]:
313
317
self .warn ('label %r not in documentation' % label )
314
318
continue
0 commit comments