diff options
Diffstat (limited to 'sphinx/builders/texinfo.py')
-rw-r--r-- | sphinx/builders/texinfo.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sphinx/builders/texinfo.py b/sphinx/builders/texinfo.py index 1a56be0f9..ee10d58c3 100644 --- a/sphinx/builders/texinfo.py +++ b/sphinx/builders/texinfo.py @@ -15,6 +15,7 @@ from typing import Any, Dict, Iterable, List, Tuple, Union from docutils import nodes from docutils.frontend import OptionParser from docutils.io import FileOutput +from docutils.nodes import Node from sphinx import addnodes, package_dir from sphinx.application import Sphinx @@ -52,8 +53,8 @@ class TexinfoBuilder(Builder): default_translator_class = TexinfoTranslator def init(self) -> None: - self.docnames = [] # type: Iterable[str] - self.document_data = [] # type: List[Tuple[str, str, str, str, str, str, str, bool]] + self.docnames: Iterable[str] = [] + self.document_data: List[Tuple[str, str, str, str, str, str, str, bool]] = [] def get_outdated_docs(self) -> Union[str, List[str]]: return 'all documents' # for now @@ -75,7 +76,7 @@ class TexinfoBuilder(Builder): 'will be written')) return # assign subdirs to titles - self.titles = [] # type: List[Tuple[str, str]] + self.titles: List[Tuple[str, str]] = [] for entry in preliminary_document_data: docname = entry[0] if docname not in self.env.all_docs: @@ -108,10 +109,10 @@ class TexinfoBuilder(Builder): with progress_message(__("writing")): self.post_process_images(doctree) docwriter = TexinfoWriter(self) - settings = OptionParser( + settings: Any = OptionParser( defaults=self.env.settings, components=(docwriter,), - read_config_files=True).get_default_values() # type: Any + read_config_files=True).get_default_values() settings.author = author settings.title = title settings.texinfo_filename = targetname[:-5] + '.info' @@ -154,7 +155,7 @@ class TexinfoBuilder(Builder): for pendingnode in largetree.traverse(addnodes.pending_xref): docname = pendingnode['refdocname'] sectname = pendingnode['refsectname'] - newnodes = [nodes.emphasis(sectname, sectname)] # type: List[nodes.Node] + newnodes: List[Node] = [nodes.emphasis(sectname, sectname)] for subdir, title in self.titles: if docname.startswith(subdir): newnodes.append(nodes.Text(_(' (in '), _(' (in '))) @@ -197,7 +198,7 @@ class TexinfoBuilder(Builder): def default_texinfo_documents(config: Config) -> List[Tuple[str, str, str, str, str, str, str]]: # NOQA """ Better default texinfo_documents settings. """ filename = make_filename_from_project(config.project) - return [(config.master_doc, filename, config.project, config.author, filename, + return [(config.root_doc, filename, config.project, config.author, filename, 'One line description of project', 'Miscellaneous')] |