Skip to content

Commit

Permalink
Support only directives that impact the TOC
Browse files Browse the repository at this point in the history
This addresses one issue noted in #132 although due to Sphinx bug
sphinx-doc/sphinx#9819 it is still not
possible to use only directives to selectively include `genindex` and
`modindex` in the global TOC.
  • Loading branch information
jbms committed Jul 27, 2022
1 parent 931df43 commit 0f12699
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sphinx_immaterial/nav_adapt.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ def visit_reference(self, node: docutils.nodes.reference):
self._url = node.get("refuri")
raise docutils.nodes.SkipChildren

# `only` directives can result in `comment` nodes.
def visit_comment(self, node: docutils.nodes.comment):
raise docutils.nodes.SkipChildren

def visit_compact_paragraph(self, node: docutils.nodes.Element):
pass

Expand Down

0 comments on commit 0f12699

Please sign in to comment.