我的Sphinx树中有很多.rst
个文件,故意从任何索引树中排除。我得到像
/filename.rst:: WARNING: document isn't included in any toctree
如何在Sphinx中禁止特定警告?
答案 0 :(得分:33)
您的Sphinx项目中是否存在您不希望输出内容的.rst文件?
使用exclude_patterns
配置变量。对于与指定模式匹配的文件,不会生成输出(也没有警告消息)。请参阅http://sphinx-doc.org/config.html#confval-exclude_patterns。
您的Sphinx项目中是否有.rst文件不属于任何toctree,但其内容应该在输出中?
在每个.rst文件的顶部添加:orphan:
以禁止显示警告消息。请参阅http://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html#file-wide-metadata