2323from sphinx import addnodes
2424from sphinx .builders import Builder
2525from sphinx .locale import translators
26+ from sphinx .util import status_iterator
2627from sphinx .util .nodes import split_explicit_title
2728from sphinx .writers .html import HTMLTranslator
28- from sphinx .writers .text import TextWriter
29+ from sphinx .writers .text import TextWriter , TextTranslator
2930from sphinx .writers .latex import LaTeXTranslator
3031from sphinx .domains .python import PyModulelevel , PyClassmember
3132
@@ -295,8 +296,11 @@ def run(self):
295296class PydocTopicsBuilder (Builder ):
296297 name = 'pydoc-topics'
297298
299+ default_translator_class = TextTranslator
300+
298301 def init (self ):
299302 self .topics = {}
303+ self .secnumbers = {}
300304
301305 def get_outdated_docs (self ):
302306 return 'all pydoc topics'
@@ -306,9 +310,9 @@ def get_target_uri(self, docname, typ=None):
306310
307311 def write (self , * ignored ):
308312 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 )):
312316 if label not in self .env .domaindata ['std' ]['labels' ]:
313317 self .warn ('label %r not in documentation' % label )
314318 continue
0 commit comments