2

下部にあるSphinxの警告をどのように修正できますか?

私は自分のPythonノートをSphinxに入れようとしています。index.rstと同じディレクトリレベルの別々のファイルにメモがあります。

HTMLをビルドした後、次の警告が表示されます

警告

/home/heo/S_codes/trig_functions.rst:: WARNING: document isn't included in any toctree

構築時の完全なメッセージ

sudo sphinx-build -b html ./ _build/html
Running Sphinx v0.6.2
loading pickled environment... done
building [html]: targets for 0 source files that are out of date
updating environment: 1 added, 2 changed, 0 removed
reading sources... [100%] trig_functions
/home/heo/S_codes/databooklet.rst:1: (WARNING/2) malformed hyperlink target.
/home/heo/S_codes/index.rst:11: (ERROR/3) Error in "toctree" directive:
invalid option block.

.. toctree::
   :numbered:
   :glob:
   *
   databooklet.rst
   trig_functions.rst


/home/heo/S_codes/trig_functions.rst:11: (ERROR/3) Unexpected indentation.
looking for now-outdated files... none found
pickling environment... done
checking consistency... /home/heo/S_codes/databooklet.rst:: WARNING: document isn't included in any toctree
/home/heo/S_codes/trig_functions.rst:: WARNING: document isn't included in any toctree
done
preparing documents... done
writing output... [100%] trig_functions
writing additional files... genindex search
copying static files... done
dumping search index... done
dumping object inventory... done
build succeeded, 6 warnings.
4

1 に答える 1

6

Sphinx のドキュメントを知っていますか? https://www.sphinx-doc.org

具体的には、toctreeディレクティブについてお読みください: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-toctree

必要な数のファイルを持つことができます。を介しtoctreeて、多くの部分から単一のドキュメントを作成できます。


実際にこれを読んでください: http://sphinx.pocoo.org/concepts.html#document-names

reST ソース ファイルにはさまざまな拡張子 (.txt が好きな人もいれば、.rst が好きな人もいます。拡張子は source_suffix で構成できます) があり、OS ごとにパス セパレーターが異なるため、Sphinx はそれらを抽象化します。すべての「ドキュメント名」は、ソース ディレクトリ、拡張子が取り除かれ、パスの区切り文字がスラッシュに変換されます。「ドキュメント」を参照するすべての値、パラメータなどは、そのようなドキュメント名を想定しています。

ドキュメント名の例は、、、indexまたは library/zipfileです reference/datamodel/types。先頭のスラッシュがないことに注意してください。

でグロブしたので*、ファイルを一覧表示する必要はありません。

ファイルをリストしたい場合は、実際に上記のルールを読みそれに従ってください。

于 2009-11-07T00:41:39.667 に答える