Sphinx忽略以_in文件名开头的py文件 [英] Sphinx ignores py-file starting with a _ in filename

查看:0
本文介绍了Sphinx忽略以_in文件名开头的py文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用test project中的Sphinx 4.4.0。我使用sphinx.ext.autodocsphinx-apidoc

但并不是所有的py文件都能被识别。看起来文件名中以_开头的文件被忽略(例如_mypackage.py)。但我不确定是这个角色还是别的什么原因。

您是否知道有修改该行为的选项?

这是项目结构

sphinx_versuch
├── docs
│   ├── make.bat
│   ├── Makefile
│   └── source
│       ├── conf.py
│       ├── index.rst
│       ├── modules.rst
│       ├── mypackage.rst
│       ├── _static
│       └── _templates
├── LICENSE
├── README.md
├── src
│   ├── mypackage
│   │   ├── a.py
│   │   ├── b.py
│   │   ├── __init__.py
│   │   └── _mypackage.py
│   ├── setup.cfg
│   └── setup.py
└── tests
    ├── __init__.py
    ├── test_a.py
    ├── test_b.py
    └── test_mypackage.py

推荐答案

--private-P选项sphinx-apidoc确保也包括专用文件(按惯例以下划线开头)。

另请参阅 https://www.sphinx-doc.org/en/master/man/sphinx-apidoc.html#cmdoption-sphinx-apidoc-P

这篇关于Sphinx忽略以_in文件名开头的py文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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