1

index.rst以下のように見えるデに問題はありません:

Sphinx RTD ドキュメントのホームページ

ただし、別のページに移動すると、私の場合はであり、以下にannotation-module.rst示すように、サイドバーは と の両方indexを選択して表示annotation-moduleします。

Sphinx RTD サイドバーに両方のメニューが表示される

ただし、注釈モジュールページのみをアクティブにして、そのサブセクションを表示したいと考えています。

以下のように環境変数を探すことによってconf.pyのみ使用します。html_themeREADTHEDOCS

if not on_rtd:  # only import and set the theme if we're building docs locally
    try:
        import sphinx_rtd_theme

        html_theme = "sphinx_rtd_theme"
        html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
    except Exception:
        pass

私のindex.rst

Welcome to exceptive's documentation!
=====================================

.. toctree::
   :maxdepth: 2
   :caption: Contents:

   index
   annotation-module

Here I have some introductory text.

またannotation-module.rst、何も含まれていませんtoctree。その下にセクションしかありません。

では、サイドバーの現在のドキュメント セクションのみを有効にするにはどうすればよいでしょうか?

これは、 Steve Piercyによって要求されたドキュメントのソース ディレクトリです。


環境

  • パイソン3.5
  • スフィンクス 1.7.6
  • スフィンクス-rtd-テーマ 0.4.0
4

2 に答える 2