I have a package:
- foo
- foo.py
- bar.py
- __init__.py
foo.py has a class Foo. In __init__.py I import class Foo so users can do:
from foo import Foo
Sphinx rightly documents Foo as foo.foo.Foo, which is right but confusing to users. How do I get Sphinx to document it as foo.Foo?
It's also important to get the overall module documentation associated with the right module.
Sphinx documents something called:
..module:: module.name
but when I use it in the first comment in a foo.py
file, the doc is still attributed to foo.foo
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…