diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-12-02 21:01:56 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-12-02 22:28:28 +0900 |
commit | a4749ca46839338329c446cba671dac008201e3e (patch) | |
tree | 94ae28f0358fa323f2b9e89ac7bcf010fd4f6428 /sphinx/builders/htmlhelp.py | |
parent | 28add225f2f11d76b7720ed4b7b76aacea6932b3 (diff) | |
download | sphinx-git-a4749ca46839338329c446cba671dac008201e3e.tar.gz |
Fix annotations for builders
Diffstat (limited to 'sphinx/builders/htmlhelp.py')
-rw-r--r-- | sphinx/builders/htmlhelp.py | 8 |
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) |