You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know sphinx-apidoc already has the -d option to set the maxdepth in the main modules TOC. However, I was wondering if this or another option could be used to add :maxdepth: to the toctree of each package, i.e. after
Any workaround for this? The documentation generated with apidoc is a bit of a mess because it is not possible to adjust the depth of package toctrees. So a package page becomes full of submodules of subpackages of subpackages of subpackages.
I had the same problem and as I run sphinx-apidoc from a separate script anyway, I fix it like this:
# sphinx-apidoc doesn't allow setting maxdepth on subpackages
sed -i "s/.. toctree::/.. toctree::\n :maxdepth: 1/g" ${SCRIPT_DIRECTORY}/_generated/*
# sphinx toctree is very indentation sensitive, make it uniform
sed -i "s/ / /g" ${SCRIPT_DIRECTORY}/_generated/*
ltalirz
added a commit
to ltalirz/aiida-core
that referenced
this issue
Mar 9, 2018
Hi,
I know sphinx-apidoc already has the -d option to set the maxdepth in the main modules TOC. However, I was wondering if this or another option could be used to add :maxdepth: to the toctree of each package, i.e. after
sphinx/sphinx/apidoc.py
Line 109 in 470bac3
Alternatively, how hard would it be to add a default maxdepth setting to Spinx itself, so that it would be configurable in conf.py?
Cheers
The text was updated successfully, but these errors were encountered: