Open spreiter opened 1 year ago
I'm also running into this problem. Any time there's more than one class in a module or non-method functions, those attributes show up as separate "submodules" in the package listing. Any help would be appreciated!
As I'm using sphinx-apidoc
, the workaround for me seems to be to NOT include the --no-headings
option and find another way to modify the headers in each file (e.g. through a callback in conf.py or by another script that cleans the final pages).
I finally once again annoyed by this, so I checked each commit in the release branch. It turns out to be f57177de89ff1a154c830558d218c3e334b2b437 , which sums up the changes introduced by #10807. I will ask there, maybe someone has an idea.
Turns out that the config needs to be adjusted to fix this ^1.
toc_object_entries = False
@spreiter I have a same issue, but
toc_object_entries = False
is not working in my project.
Could you tell me detail how to hidden about submodules and packages in toc
FYI
conf.py
import os
import sys
sys.path.insert(0, os.path.abspath("../"))
sys.path.insert(0, os.path.abspath("../src/"))
project = "model-proj"
release = "1.0.0"
extensions = ["sphinx.ext.autodoc", "myst_parser"]
templates_path = ["_templates"]
language = "ja"
html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
# hidden submodules headings
toc_object_entries = False
shell command
sphinx-apidoc -f -o source ../ && make html
Hi @Yuhi-Aoki ,
Not sure, whether this helps, but maybe try to toc level:
html_theme_options = {
'globaltoc_maxdepth': 0,
}
And if you want to exclude certain submodules or folders, you can specify those during the shell command:
sphinx-apidoc -f -o source ../ [PATH-TO-EXCLUDE ...]
Cheers
Describe the bug
In our project we use autodoc. After updating Sphinx to >=5.2 one package is messed up. In its sub packages and sub modules not only the single modules are listed, but also all functions, classes etc.
Part of config:
Our folder structure looks like this:
and the HTML of lib looks like this:
I have the impression that his is related to #6316, but not sure.
How to Reproduce
source/index.rst
:command: in the
/doc
folder:Environment Information
Sphinx extensions
No response
Additional context
No response