Sphinx sphinx-apidoc generated module titles are too long (full package path). How can I shorten them?
00:23 20 Nov 2025

I am generating python API documentation using Sphinx and sphinx-apidoc with sphinx-rtd-theme

The problem is:

The page titles and ToC entries for modules/packages always show the full import path, e.g. myproject.subpackage.longname.module

This makes the sidebar and headings extremely long.

What I already solved

Using the following in conf.py:

add_module_names = False

This successfully removes the module prefix from class names.

What I already tried

  1. toc_object_entries_show_parents

toc_object_entries_show_parents = False

Question

Is there a way to configure Sphinx so that module/package titles are short names rather than full import paths?

python documentation sphinx