如何修复底部狮身人面像的警告?
我正在尝试在 Sphinx 中保存我的 Python 笔记。 我的笔记位于与 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.
最佳答案
您了解 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
Since the reST source files can have different extensions (some people like .txt, some like .rst – the extension can be configured with source_suffix) and different OSes have different path separators, Sphinx abstracts them: all “document names” are relative to the source directory, the extension is stripped, and path separators are converted to slashes. All values, parameters and suchlike referring to “documents” expect such a document name.
Examples for document names are
index
,library/zipfile
, orreference/datamodel/types
. Note that there is no leading slash.
由于您使用 *
进行了通配,因此您无需列出文件。
如果您想列出您的文件,请实际阅读并遵循上述规则。
关于python - 我的笔记的 Sphinx 源位置 - 警告 : document isn't included in any toctree,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1690757/