问题
I have a python project and a structure like this
project
|-- doc
|-- src
|-- mod_1.py
| |-- Class1
|-- package1
|-- mod_2.py
|-- Class2
I used sphinx-apidoc
to create my documentation and the path to my submodules look like this
src.mod1
src.package2.mod2
Now I wonder, if there is a way to remove the src
prefix?
To make the path look like this
mod1
package2.mod2
回答1:
After raising an issue at GitHub sphinx #3113, shimizukawa came up with a solution:
- Remove
__init__.py
fromsrc
folder - Set pythonpath to
/../src
instead of/../
in theconf.py
来源:https://stackoverflow.com/questions/36579500/can-i-remove-the-src-package-from-python-doc-generated-with-sphinx