Skip to content

fix(viewcode): do not generate module pages for unused modules (#14675) - #14676

Open
GTUTETTY wants to merge 1 commit into
sphinx-doc:masterfrom
GTUTETTY:fix/issue-14675
Open

GTUTETTY wants to merge 1 commit into
sphinx-doc:masterfrom
GTUTETTY:fix/issue-14675

Conversation

@GTUTETTY

Copy link
Copy Markdown

Purpose

Prevent sphinx.ext.viewcode from emitting module pages (_modules/<module>.html) and index entries when no documented objects in that module are linked (used is empty). This eliminates output discrepancies between serial and parallel builds where unlinked modules could leak into generated output.

  • Added filtering in env_merge_info to ignore module entries with empty used.
  • Added filtering in collect_pages to only process and index modules that have active used entries.
  • Added regression tests in tests/test_extensions/test_ext_viewcode.py.

References

AI Disclosure

Assisted by Google Antigravity for code navigation and reproduction testing. The implementation, tests, and diff boundaries were manually inspected, reviewed, and verified locally by the author.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sphinx.ext.viewcode generates a module page with no source links

1 participant