Skip to content

Record only the objects a module defines in viewcode - #14815

Open
kdeldycke wants to merge 1 commit into
sphinx-doc:masterfrom
kdeldycke:viewcode-instance-entries
Open

kdeldycke wants to merge 1 commit into
sphinx-doc:masterfrom
kdeldycke:viewcode-instance-entries

Conversation

@kdeldycke

Copy link
Copy Markdown
Contributor

Purpose

This PR fix orphan source pages and wrong links.

This PR closes #14675.

References

viewcode makes the "view source" pages under _modules/. It starts a module's record from the first documented object that points to that module, even when the module does not define the object.

AI Disclosure

AI used as a fancy auto-complete in my code editor.

@kdeldycke

Copy link
Copy Markdown
Contributor Author

I just realized after proposing that PR that 2 others are overlapping at:

So fill free to close that one as duplicate if any of those are better, and also feel free to steal my code from here to complement/extend the other two if one takes precedence.

@kdeldycke

Copy link
Copy Markdown
Contributor Author

Ah but something that this PR fixes that the other 2 does not is the wrong [docs] anchor (which more or less relates to #6651 but not exactly).

@Darlokt

Darlokt commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

@kdeldycke No problem! Sorry, I was looking thorugh your PR and I completely missed the contributing cache problem underneath the to me visual problem. If its okay with you I will include/fold this into #14677 or a separate PR, depending on a further third view at viewcode/scope. Thanks for the heads up!

@kdeldycke

Copy link
Copy Markdown
Contributor Author

Feel free to fold it into #14677 if it speed up the merge upstream, no worries.

@jdillard jdillard added the extensions:viewcode The `sphinx.ext.linkcode` or `sphinx.ext.viewcode` extensions label Nov 4, 2026
kdeldycke added a commit to kdeldycke/extra-platforms that referenced this pull request Nov 5, 2026

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

extensions:viewcode The `sphinx.ext.linkcode` or `sphinx.ext.viewcode` extensions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants