Open arski opened 9 years ago
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/*
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 https://github.com/sphinx-doc/sphinx/blob/470bac3d1c17f2728573f96c2864ab07918692d2/sphinx/apidoc.py#L109
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