Repository navigation
[docs] Document the :ref: label requirement and default_role in the style guide - #65869
Merged
Merged
Conversation
…tyle guide
Two facts about Ray's Sphinx config weren't written down where
contributors or agents would find them:
- autosectionlabel isn't enabled, so a heading's text isn't a {ref}
target on its own; every linked section needs an explicit label.
- default_role is code, so a bare single-backtick in reStructuredText
renders as inline code, not italics or a broken role.
Both were rediscovered from conf.py during recent Ray Data style passes.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the Ray writing style guide documentation. It adds a note clarifying how to italicize terms in reStructuredText and MyST Markdown using asterisks, explaining that single backticks render as inline code. Additionally, it explains that the Sphinx autosectionlabel extension is not enabled, meaning explicit labels are required for linking to sections to ensure stability when headings are reworded. There are no review comments to address.
| ## The section to link | ||
| ``` | ||
|
|
||
| Ray docs don't enable Sphinx's `autosectionlabel` extension, so a heading's text isn't a `{ref}` target on its own. Every section you link to needs an explicit label. The tradeoff favors stability: rewording a heading can't break an existing `{ref}`, because the label is a separate line that the edit leaves untouched. |
Contributor
There was a problem hiding this comment.
Suggested change
| Ray docs don't enable Sphinx's `autosectionlabel` extension, so a heading's text isn't a `{ref}` target on its own. Every section you link to needs an explicit label. The tradeoff favors stability: rewording a heading can't break an existing `{ref}`, because the label is a separate line that the edit leaves untouched. | |
| Ray docs don't enable Sphinx's `autosectionlabel` extension, so a heading's text isn't a `{ref}` target on its own. Every section you link to needs an explicit label. The tradeoff favors stability: rewording a heading can't break an existing `{ref}`, because the label is a separate line that the edit leaves untouched. |
Is 'Ray docs' a plural thing or singular (i.e., Ray doc set) in this case? IOW, is don't better than doesn't?
ronny-anyscale
approved these changes
Sep 2, 2026
nadongjun
pushed a commit
to nadongjun/ray
that referenced
this pull request
Oct 6, 2026
…tyle guide (ray-project#65869) ## Summary Documents two facts about Ray's Sphinx configuration in the documentation style guide. Neither was written down anywhere contributors or agents would find them, and both were rediscovered from `conf.py` during recent Ray Data style passes (ray-project#65374, ray-project#65525). - Ray doesn't enable `autosectionlabel`, so a heading's text isn't a `{ref}` target on its own and every linked section needs an explicit label. Added to the cross-references section, which already showed the `(my-label)=` pattern but never said why it's required. - Ray sets `default_role = "code"`, so a bare single-backtick in reStructuredText renders as inline code, not italics or a broken role. Added as a note in the bold-and-italics section. This one nearly produced ~50 false "single backticks are a rendering bug" findings in a prior review pass. ## Why this isn't a duplicate Searched open PRs with `gh pr list --search` for `writing-style`, `autosectionlabel`, `default_role`, and `anchor`. No open PR documents these. ## Test plan Prose-only change under `doc/`. A change to only `.md` files under `doc/` runs no library test steps; the Read the Docs render gate validates the build. Both claims were verified directly against `doc/source/conf.py` (`autosectionlabel` absent from `extensions`; `default_role = "code"`). ## AI assistance Drafted with AI assistance (Claude Code). Facts verified against `doc/source/conf.py`. The submitter reviews every changed line before requesting review. Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.8 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Documents two facts about Ray's Sphinx configuration in the documentation style guide. Neither was written down anywhere contributors or agents would find them, and both were rediscovered from
conf.pyduring recent Ray Data style passes (#65374, #65525).autosectionlabel, so a heading's text isn't a{ref}target on its own and every linked section needs an explicit label. Added to the cross-references section, which already showed the(my-label)=pattern but never said why it's required.default_role = "code", so a bare single-backtick in reStructuredText renders as inline code, not italics or a broken role. Added as a note in the bold-and-italics section. This one nearly produced ~50 false "single backticks are a rendering bug" findings in a prior review pass.Why this isn't a duplicate
Searched open PRs with
gh pr list --searchforwriting-style,autosectionlabel,default_role, andanchor. No open PR documents these.Test plan
Prose-only change under
doc/. A change to only.mdfiles underdoc/runs no library test steps; the Read the Docs render gate validates the build. Both claims were verified directly againstdoc/source/conf.py(autosectionlabelabsent fromextensions;default_role = "code").AI assistance
Drafted with AI assistance (Claude Code). Facts verified against
doc/source/conf.py. The submitter reviews every changed line before requesting review.