2012-10-17 56 views
20

我有許多.rst文件在我的獅身人面像樹中有意從任何索引樹中排除。我得到如下警告:禁用個人Sphinx警告消息

/filename.rst:: WARNING: document isn't included in any toctree 

如何禁止在Sphinx中使用特定的警告?

回答

29
  1. 有沒有在你的獅身人面像的項目,其內容不希望在輸出.rst文件?

    使用exclude_patterns配置變量。對於與指定模式匹配的文件,不會生成輸出(並且不會有警告消息)。請參閱http://sphinx-doc.org/config.html#confval-exclude_patterns

  2. 您的Sphinx項目中是否存在不屬於任何toctree但其內容應該位於輸出中的第一個文件?

    在每個.rst文件的頂部添加:orphan:以禁止警告消息。請參閱http://sphinx-doc.org/markup/misc.html#file-wide-metadata

+2

感謝提到:孤兒: – dghubble