Repository navigation
[doc] Soft-wrap remaining hard-wrapped prose in doc/source - #66607
Conversation
softwrap.py treated consecutive `%` comment lines as a paragraph and joined them, which folds a commented-out block, such as a Mermaid diagram source, onto one unreadable line. Comments don't render, so verify.py's render oracle reported the result as clean. Treat each `%` line as a verbatim boundary and add a selftest case. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
Whitespace-only: joins the lines inside each paragraph and list item. No words change. Generated with the ray-soft-wrap skill and checked with its verify.py (content invariant, render equality, idempotency). Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request introduces support for preserving MyST line comments (lines starting with %) in the soft-wrap script, preventing them from being joined into surrounding prose. It also applies soft-wrapping to several documentation files. The review feedback suggests updating the MyST comment regular expression to support arbitrary leading whitespace, ensuring nested comments (e.g., inside lists or blockquotes) are also correctly preserved, and adding a corresponding test case to verify this behavior.
| # A MyST line comment. Every line starting with % is its own comment, so joining | ||
| # a run of them folds a commented-out block, such as a Mermaid source, onto one | ||
| # unreadable line. Comments don't render, so verify.py's oracle can't see this. | ||
| MYST_COMMENT_RE = re.compile(r"^\s{0,3}%") |
There was a problem hiding this comment.
MyST comments can be nested inside list items, blockquotes, or custom containers (like :::{note}), which often introduces 4 or more spaces of indentation. If MYST_COMMENT_RE only matches up to 3 spaces of indentation, these nested comments will not be recognized as boundaries and will be joined into the surrounding prose. Once joined, the % character will no longer be at the start of the line, causing MyST to render the comment text literally in the public documentation. Changing the regex to allow any amount of leading whitespace prevents this issue.
| MYST_COMMENT_RE = re.compile(r"^\s{0,3}%") | |
| MYST_COMMENT_RE = re.compile(r"^\s*%") |
There was a problem hiding this comment.
Good catch. Confirmed with mdit-py-plugins that * Item 1\n % comment line parses as a myst_line_comment, so joining it would have rendered the text. Switched to ^\s*% in e763c7a. Over-matching a non-comment % line only leaves it unjoined, which is the safe direction. A re-run over doc/source produces no new changes.
| ( | ||
| "MyST % comment lines keep their lines", | ||
| "% flowchart TD\n% A --> B\n\nProse that\njoins.\n", | ||
| "% flowchart TD\n% A --> B\n\nProse that joins.\n", | ||
| ), |
There was a problem hiding this comment.
Add a test case to verify that nested/indented MyST comments (with 4 or more spaces of indentation) are correctly preserved and not joined into preceding list items or prose.
(
"MyST % comment lines keep their lines",
"% flowchart TD\n% A --> B\n\nProse that\njoins.\n",
"% flowchart TD\n% A --> B\n\nProse that joins.\n",
),
(
"Nested MyST % comment lines keep their lines",
"* Item 1\n % comment line\n",
"* Item 1\n % comment line\n",
),There was a problem hiding this comment.
Added as "a nested MyST % comment line keeps its line" in e763c7a. Selftest is 13 cases, 0 failures.
| * Linux worker nodes (the RocksDB backend is Linux only). | ||
| * A `StorageClass` that provisions a durable volume which can reattach to the node that runs | ||
| the recovered head Pod. | ||
| * A `StorageClass` that provisions a durable volume which can reattach to the node that runs the recovered head Pod. |
There was a problem hiding this comment.
| * A `StorageClass` that provisions a durable volume which can reattach to the node that runs the recovered head Pod. | |
| * A `StorageClass` that provisions a durable volume capable of reattaching to the node that runs the recovered head Pod. |
The which should be that but then you have two thats real close like
## Why Small, self-contained docs fixes found during other docs work, collected into one PR. Ray's `AGENTS.md` asks for trivial edits to be bundled instead of opened as one-off PRs, so this batch keeps collecting fixes and goes up for review about once a week. Each fix is its own commit, so a reviewer can drop any one without touching the rest. ## What - **Trailing space inside link text** (`vsphere.md`, `data/contributing/contributing-guide.md`). Two links' text ended in a space, such as `[… (WCP) enabled ](…)`, so the rendered underline ran past the last word. Removed the space. Found while fixing the same pattern in the Ray Data MyST conversion (#66375). - **Duplicated paragraph** (`serve/llm/user-guides/configuration.md`). The "Set `accelerator_type`" paragraph appeared twice back to back, with the same content in a different sentence order, apparently a suggestion-merge artifact from #65026 that also dropped the blank line after the heading. Kept the first copy and restored the blank line. - **Escaped sub-bullets** (`ray-core/internals/autoscaler-v2.md`, `ray-core/internals/ray-event-exporter.md`). The rST originals nested these sub-bullets without the blank line rST requires, so they rendered as run-on text, and the MyST conversion (#66430) carried them over as `\-`. Dropped the escapes so they render as the nested lists the author intended. Both of these fixes turned up during the soft-wrap pass in #66607. ## Not a duplicate There's no open PR touching any of these files, and a GitHub search for `vsphere.md`, `contributing-guide.md`, "vSphere WCP", `configuration.md` with `accelerator_type`, `autoscaler-v2`, and `ray-event-exporter` finds nothing related. ## Testing - Rendered both pages with `markdown-it-py` (CommonMark). Each link's text now ends right at `</a>`, with no trailing whitespace. - A regex scan of every `doc/source/**/*.md` outside code fences for whitespace before `](` finds these two as the only cases on `master`. - Rendered `autoscaler-v2.md` and `ray-event-exporter.md` with `markdown-it-py` and confirmed each sub-bullet group is now a nested `<ul>` under its parent item. - Confirmed `configuration.md` has one copy of the paragraph, preceded by a blank line after the heading. - Pre-commit hooks passed on every commit. AI assistance (Claude Code) was used to find and make these fixes. I reviewed each change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
MyST parses a % line nested four or more spaces deep in a list item as a comment, so the 0-3 space limit let the engine join it onto the item, where it would render as literal text. Match any indentation and add a selftest case. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
… FT guide Replace "which can reattach" with "capable of reattaching", avoiding both a restrictive "which" and a second "that" in the same sentence. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
## Why Small, self-contained docs fixes found during other docs work, collected into one PR. Ray's `AGENTS.md` asks for trivial edits to be bundled instead of opened as one-off PRs, so this batch keeps collecting fixes and goes up for review about once a week. Each fix is its own commit, so a reviewer can drop any one without touching the rest. ## What - **Trailing space inside link text** (`vsphere.md`, `data/contributing/contributing-guide.md`). Two links' text ended in a space, such as `[… (WCP) enabled ](…)`, so the rendered underline ran past the last word. Removed the space. Found while fixing the same pattern in the Ray Data MyST conversion (ray-project#66375). - **Duplicated paragraph** (`serve/llm/user-guides/configuration.md`). The "Set `accelerator_type`" paragraph appeared twice back to back, with the same content in a different sentence order, apparently a suggestion-merge artifact from ray-project#65026 that also dropped the blank line after the heading. Kept the first copy and restored the blank line. - **Escaped sub-bullets** (`ray-core/internals/autoscaler-v2.md`, `ray-core/internals/ray-event-exporter.md`). The rST originals nested these sub-bullets without the blank line rST requires, so they rendered as run-on text, and the MyST conversion (ray-project#66430) carried them over as `\-`. Dropped the escapes so they render as the nested lists the author intended. Both of these fixes turned up during the soft-wrap pass in ray-project#66607. ## Not a duplicate There's no open PR touching any of these files, and a GitHub search for `vsphere.md`, `contributing-guide.md`, "vSphere WCP", `configuration.md` with `accelerator_type`, `autoscaler-v2`, and `ray-event-exporter` finds nothing related. ## Testing - Rendered both pages with `markdown-it-py` (CommonMark). Each link's text now ends right at `</a>`, with no trailing whitespace. - A regex scan of every `doc/source/**/*.md` outside code fences for whitespace before `](` finds these two as the only cases on `master`. - Rendered `autoscaler-v2.md` and `ray-event-exporter.md` with `markdown-it-py` and confirmed each sub-bullet group is now a nested `<ul>` under its parent item. - Confirmed `configuration.md` has one copy of the paragraph, preceded by a blank line after the heading. - Pre-commit hooks passed on every commit. AI assistance (Claude Code) was used to find and make these fixes. I reviewed each change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
…ct#66607) ## Why are these changes needed? Most of `doc/source` is already soft-wrapped (one line per paragraph and list item). This finishes the job for the 11 pages that still had hard-wrapped prose, so later edits to them produce clean, reviewable diffs. The change is **whitespace-only**: it joins the lines inside a paragraph or list item and changes no words. Code, directives, tables, front matter, and comments are untouched. The one exception is a reviewer-suggested wording fix in `kuberay-gcs-rocksdb-ft.md` ("which can reattach" → "capable of reattaching"), in its own commit. It also fixes a gap in the `ray-soft-wrap` engine that this pass surfaced. `softwrap.py` joined consecutive MyST `%` comment lines, which would have folded the commented-out Mermaid sources in `ray-core/internals/object-spilling.md` (and a comment in `job-submission/api.md`) onto single 1,000–2,000 character lines. Comments don't render, so the render-equality check couldn't see it. The engine now treats each `%` line, at any indentation, as a boundary, with new selftest cases. It's a separate commit. Intentionally left hard-wrapped: - `cluster/kubernetes/references/api.md`: generated file, so a regeneration would overwrite any wrapping change. - `ray-core/internals/autoscaler-v2.md`, `ray-core/internals/ray-event-exporter.md`: escaped `\-` pseudo sub-bullets. Joining them renders identically but hides the broken structure. They need converting to real nested lists, which is a content edit. - `serve/llm/user-guides/configuration.md`: the "Set `accelerator_type`…" paragraph is duplicated on master. Soft-wrapping would merge the two copies onto one line. Needs a content fix first. ## Not a duplicate Searched open PRs for "soft-wrap" and "soft wrap"; no open PR does this. This is the follow-through on the existing `ray-soft-wrap` skill, bundled with the engine fix above. ## Testing - `python3 doc/.claude/skills/ray-soft-wrap/scripts/softwrap.py --selftest`: 13 cases, 0 failures. - `python3 doc/.claude/skills/ray-soft-wrap/scripts/verify.py <changed files>`: all 11 files `content=ok render=ok idempotent=ok` against the pre-transform state (the later wording commit is excluded from that whitespace-only check). - `pre-commit run --files <changed files>`: passed. - Reviewed the full diff by hand. Checked that no `%` comment lines were joined and that no card or directive markers changed. ## AI assistance This PR was prepared with AI assistance (Claude Code). I reviewed every changed line. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Why are these changes needed?
Most of
doc/sourceis already soft-wrapped (one line per paragraph and list item). This finishes the job for the 11 pages that still had hard-wrapped prose, so later edits to them produce clean, reviewable diffs.The change is whitespace-only: it joins the lines inside a paragraph or list item and changes no words. Code, directives, tables, front matter, and comments are untouched.
The one exception is a reviewer-suggested wording fix in
kuberay-gcs-rocksdb-ft.md("which can reattach" → "capable of reattaching"), in its own commit.It also fixes a gap in the
ray-soft-wrapengine that this pass surfaced.softwrap.pyjoined consecutive MyST%comment lines, which would have folded the commented-out Mermaid sources inray-core/internals/object-spilling.md(and a comment injob-submission/api.md) onto single 1,000–2,000 character lines. Comments don't render, so the render-equality check couldn't see it. The engine now treats each%line, at any indentation, as a boundary, with new selftest cases. It's a separate commit.Intentionally left hard-wrapped:
cluster/kubernetes/references/api.md: generated file, so a regeneration would overwrite any wrapping change.ray-core/internals/autoscaler-v2.md,ray-core/internals/ray-event-exporter.md: escaped\-pseudo sub-bullets. Joining them renders identically but hides the broken structure. They need converting to real nested lists, which is a content edit.serve/llm/user-guides/configuration.md: the "Setaccelerator_type…" paragraph is duplicated on master. Soft-wrapping would merge the two copies onto one line. Needs a content fix first.Not a duplicate
Searched open PRs for "soft-wrap" and "soft wrap"; no open PR does this. This is the follow-through on the existing
ray-soft-wrapskill, bundled with the engine fix above.Testing
python3 doc/.claude/skills/ray-soft-wrap/scripts/softwrap.py --selftest: 13 cases, 0 failures.python3 doc/.claude/skills/ray-soft-wrap/scripts/verify.py <changed files>: all 11 filescontent=ok render=ok idempotent=okagainst the pre-transform state (the later wording commit is excluded from that whitespace-only check).pre-commit run --files <changed files>: passed.%comment lines were joined and that no card or directive markers changed.AI assistance
This PR was prepared with AI assistance (Claude Code). I reviewed every changed line.
🤖 Generated with Claude Code