Skip to content

Nested rst:directive:option is un-nested in TOC #10827

@mgeier

Description

@mgeier

Describe the bug

Follow-up to #10807 (comment).

How to Reproduce

conf.py:

# empty

index.rst:

Hello!
======

.. toctree::

   rst

rst.rst:

reST Domain
===========

This example is taken from
https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#directive-rst-directive-option:

.. rst:directive:: toctree

   .. rst:directive:option:: caption: caption of ToC

   .. rst:directive:option:: glob

Expected behavior

Since rst:directive:option is nested within rst:directive, I would expect it's TOC entry to be nested as well.

Your project

https://insipid-sphinx-theme.readthedocs.io/en/sphinx5.x/showcase/api-doc.html

Screenshots

image

OS

any

Python version

any

Sphinx version

5.x branch, after #10807

Sphinx extensions

No response

Extra tools

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions