Skip to content

Rename the ref role to obj - #25

Merged
djungelorm merged 1 commit into
mainfrom
obj-role
Oct 15, 2026
Merged

djungelorm merged 1 commit into
mainfrom
obj-role

Conversation

@djungelorm

@djungelorm djungelorm commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Problem. Sphinx resolves an unprefixed role in the default domain before std. With .. default-domain:: cs or primary_domain = 'cs', a plain :ref: became :cs:ref:, and section labels failed with "cs:ref reference target not found".

Fix. Rename the role to :cs:obj:, following :py:obj:, which also matches any object type. any would shadow the global :any: role in the same way.

Testing. A new render test builds with cs as the default domain and checks that :ref: reaches a section label. It failed before the rename. The test-basic project now uses both :ref: and :obj: in its nitpicky build.

With cs as the default domain, Sphinx resolved a plain :ref: as :cs:ref:, so section labels were not found. The obj name follows :py:obj:, which also matches any object type.
@djungelorm
djungelorm merged commit d2acd04 into main Oct 15, 2026
7 checks passed
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.

1 participant