summaryrefslogtreecommitdiff
path: root/sphinx/builders/htmlhelp.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-12-02 23:55:36 +0900
committerGitHub <noreply@github.com>2018-12-02 23:55:36 +0900
commit8068cef267d771cd933316ba93b13665e8282c9d (patch)
tree94ae28f0358fa323f2b9e89ac7bcf010fd4f6428 /sphinx/builders/htmlhelp.py
parent28add225f2f11d76b7720ed4b7b76aacea6932b3 (diff)
parenta4749ca46839338329c446cba671dac008201e3e (diff)
downloadsphinx-git-8068cef267d771cd933316ba93b13665e8282c9d.tar.gz
Merge pull request #5703 from tk0miya/fix_typehints_for_builders
Fix annotations for builders
Diffstat (limited to 'sphinx/builders/htmlhelp.py')
-rw-r--r--sphinx/builders/htmlhelp.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/sphinx/builders/htmlhelp.py b/sphinx/builders/htmlhelp.py
index 9ba7ae9b0..1588e61fd 100644
--- a/sphinx/builders/htmlhelp.py
+++ b/sphinx/builders/htmlhelp.py
@@ -22,6 +22,7 @@ from sphinx.config import string_classes
from sphinx.environment.adapters.indexentries import IndexEntries
from sphinx.locale import __
from sphinx.util import logging
+from sphinx.util.nodes import NodeMatcher
from sphinx.util.osutil import make_filename_from_project
from sphinx.util.pycompat import htmlescape
@@ -294,11 +295,8 @@ class HTMLHelpBuilder(StandaloneHTMLBuilder):
for subnode in node:
write_toc(subnode, ullevel)
- def istoctree(node):
- # type: (nodes.Node) -> bool
- return isinstance(node, addnodes.compact_paragraph) and \
- 'toctree' in node
- for node in tocdoc.traverse(istoctree):
+ matcher = NodeMatcher(addnodes.compact_paragraph, toctree=True)
+ for node in tocdoc.traverse(matcher): # type: addnodes.compact_paragraph
write_toc(node)
f.write(contents_footer)