我有很多 .rst
我的 Sphinx 树中有意从任何索引树中排除的文件。我收到类似的警告
/filename.rst:: WARNING: document isn't included in any toctree
如何抑制 Sphinx 中的特定警告?
请您参考如下方法:
使用
exclude_patterns
配置变量。对于与指定模式匹配的文件,不会生成任何输出(也不会生成警告消息)。见 http://www.sphinx-doc.org/en/master/usage/configuration.html#confval-exclude_patterns .添加
:orphan:
在每个 .rst 文件的顶部以禁止显示警告消息。见 http://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html#file-wide-metadata