質問のセクション レイアウトにはいくつかの問題があります。
代わりに私が得るのはこれです:
self
toctree エントリとして使用すると、含まれているファイルの最も外側のセクション タイトルが.rst
toctree エントリのその行に含まれます。エントリは、self
サブセクションまたは兄弟セクションをレンダリングせず、最も外側のセクション タイトルのみをレンダリングします。これは、toctree エントリの通常のプロパティに反します。
上記の結果として生じる 2 つの結果は、質問の例ですぐにわかります。
title
development
セクション階層の同じレベルにあると誤ってレンダリングされます。ファイルが toctree に含まれている場合.rst
、そのセクションは、セクション階層内で toctree ディレクティブが宣言されているセクションの下に配置されます。

title
.rst
包含が外部 toctree に配置されている場合、異なるレベルにあるため、2 回繰り返されます。

対応する title.rst:
=====
Title
=====
Subsection
----------
Some documentation.
Contents
--------
.. toctree::
:maxdepth: 2
self
development
対応する development.rst:
development
===========
some text
Subsection inside development.rst
---------------------------------
対応するexterior.rst:
Exterior
========
.. toctree::
:maxdepth: 4
title
toctree ディレクティブのプロパティに反するセクション構造を目指すのは、良い設計上の選択ではありません。質問の仕様から、最も単純で概念的に健全な解決策は、contents
ディレクティブ.rst
を使用して、特定のドキュメント内のセクションをリストすることです。
TOC で期待するのは次のようなものです。
最も簡単な選択は、別々のファイルを使用しtitle.rst
て、 toctreedevelopment.rst
の同じレベルに配置することです。index.rst
対応する index.rst:
Exterior
========
.. toctree::
title
development
.rst
特定のファイルの内部と外部の両方の参照ツリーを作成するには、ハイパーリンク ターゲットの単純な箇条書きリストを使用するのが最善の解決策です。

対応する title.rst:
.. _target_title:
=====
Title
=====
.. _target_subsection_title:
Subsection inside title.rst
---------------------------
Some documentation.
.. _target_contents:
Contents
--------
text
- :ref:`Title <target_title>`
- :ref:`Subsection <target_subsection_title>`
- :ref:`Contents <target_contents>`
- :ref:`Development <target_development>`
- :ref:`Subsection <target_subsection_development>`
対応する development.rst:
.. _target_development:
development
===========
some text
.. _target_subsection_development:
Subsection inside development.rst
---------------------------------
対応するexterior.rst:
Exterior
========
.. toctree::
:maxdepth: 4
title
development
次に、.. include: ディレクティブを使用して index.rst にコンテンツを含めます。
ディレクティブを使用すると.. include::
、toctree の問題が完全に解決されるわけではなく、問題の場所が変わるだけです。