我的笔记的狮身人面像来源位置

问题描述 投票:2回答:1

如何在底部修复Sphinx的警告?

我正在尝试在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.
python python-sphinx
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进行配置)不同的操作系统有不同的路径分隔符,Sphinx对它们进行了抽象:全部“文档名称”是相对于源目录,扩展名为剥离,并且路径分隔符是转换为斜线。所有值参数等“文件”期望这样的文件名称。

文档名称的示例为indexlibrary/zipfile,或reference/datamodel/types。注意没有前导斜线。

由于使用了*,因此您无需列出文件。

如果要列出文件,请实际上阅读关注上述规则。

© www.soinside.com 2019 - 2024. All rights reserved.