Skip to content

Restore Sphinx manpage reference rendering with Docutils 0.22 - #14436

Closed
Mirochill wants to merge 3 commits into
sphinx-doc:masterfrom
Mirochill:fix-14427-manpage-references
Closed

Mirochill wants to merge 3 commits into
sphinx-doc:masterfrom
Mirochill:fix-14427-manpage-references

Conversation

@Mirochill

@Mirochill Mirochill commented May 18, 2026 •

Copy link
Copy Markdown

Summary

  • restore Sphinx's custom manpage reference renderer after Docutils 0.22 installs an instance-level visit_reference
  • preserve the historical reference styling tuple when newer Docutils versions no longer expose it
  • add a regression test for :ref: and :doc: rendering in man pages

Root cause

Docutils 0.22 assigns visit_reference on the manpage translator instance according to its text_references setting. That shadows ManualPageTranslator's specialized Sphinx implementation, so internal references render as raw <uri> fragments such as <#other-ref> and <> instead of styled text.

Fixes #14427.

Validation

  • Not run locally
  • relying on the repository's GitHub Actions / Read the Docs checks for remote validation

@Mirochill
Mirochill force-pushed the fix-14427-manpage-references branch from c27afca to b24d491 Compare May 18, 2026 15:43
@Mirochill
Mirochill marked this pull request as ready for review May 18, 2026 16:10
Comment thread sphinx/writers/manpage.py Resolved
@Mirochill

Copy link
Copy Markdown
Author

Applied the suggested instance-handler cleanup and restored visit_reference method lookup. Added a regression for custom translator overrides. All 8 manpage tests pass locally on Python 3.12 with both Docutils 0.21.2 and 0.22; Ruff lint and formatting checks pass.

Updated in 956dd1d.

@Mirochill

Copy link
Copy Markdown
Author

The new mypy job identified an untyped method in the custom-translator regression. Added its nodes.reference and None annotations in 80d6450; the 8 manpage tests and Ruff checks still pass. The inspected Python 3.13 job passed 2399 tests and failed only the unrelated time.asctime signature expectation in test_cfunction. New CI is running.

@AA-Turner AA-Turner closed this Oct 22, 2026
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

ai-policy-violation awaiting:response Waiting for a response from the author of this issue builder:manpage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bad references in man pages

3 participants