Python Sphinx排除模式 [英] Python Sphinx exclude patterns

查看:162
本文介绍了Python Sphinx排除模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Sphinx为具有以下结构的项目生成文档:

I'm generating documentation with Sphinx for project with structure like this :

+ project
|
+- docs
|
+- tests
|
+- workflow -+- definitions -+- <some folders>
             | 
             +- <rest of the project>

我想从文档中排除测试和工作流程/定义。

I want to exclude tests, and workflow/definition from documentation.

我尝试在docs / conf.py中排除模式

I tried exclude pattern in docs/conf.py

exclude_patterns = ['**/workflow/definitions', 'workflow/definitions', '*workflow/definitions', 'workflow/definitions*', 'workflow/definitions/*', 'workflow/definitions/*.*']

尽管工作流/定义仍然会自动生成。

But even though workflow/definitions are still automatically generated.

有人可以告诉我正确的排除模式如何忽略 definitions文件夹吗?

Could someone show me correct exclude pattern how to ignore 'definitions' folder ?

推荐答案

exclude_patterns 可用于从 sphinx-build 排除源文件(reStructuredText文件)。 strong>。

exclude_patterns can be used to exclude source files (reStructuredText files) from processing by sphinx-build.

exclude_patterns 在使用 sphinx-apidoc 可以从Python模块生成reStructuredText文件(但是您可以告诉 sphinx-apidoc ,则应从生成中排除某些路径名。)

exclude_patterns has no effect when using sphinx-apidoc to generate reStructuredText files from Python modules (but you can tell sphinx-apidoc that certain pathnames should be excluded from the generation).

这篇关于Python Sphinx排除模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆