我的笔记的 Sphinx 源位置 - 警告:文档不包含在任何目录树中
如何修复 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.
How can you fix the Sphinx's warning at the bottom?
I am trying to have my Python notes in Sphinx.
I have my notes in separate files at the same directory level as the index.rst.
I get the following warnings after building HTML
The warning
/home/heo/S_codes/trig_functions.rst:: WARNING: document isn't included in any toctree
in
The complete message when building
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您了解 Sphinx 的文档吗? https://www.sphinx-doc.org
具体来说,请阅读
toctree 指令:https://www. sphinx-doc.org/en/master/usage/restructivetext/directives.html#directive-toctree
您可以拥有任意数量的文件。通过
toctree
,您可以从多个部分创建一个文档。请实际阅读这个:http://sphinx.pocoo。 org/concepts.html#document-names
由于您使用
*
进行了通配,因此您不需要列出文件。如果您想列出您的文件,请实际阅读并遵循上述规则。
Are you aware of Sphinx's documentation? https://www.sphinx-doc.org
Specifically, read about the
toctree
directive: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-toctreeYou can have as many files as you want. Via
toctree
you can create a single document from many parts.Please actually read this: http://sphinx.pocoo.org/concepts.html#document-names
Since you globbed with
*
, you do not need to list your files.If you want to list your files, please actually read and follow the above rules.