Skip to content

[doc] Soft-wrap remaining hard-wrapped prose in doc/source - #66607

Merged
dstrodtman merged 4 commits into
masterfrom
djs-260930-soft-wrap-docs
Sep 30, 2026
Merged

dstrodtman merged 4 commits into
masterfrom
djs-260930-soft-wrap-docs

Conversation

@dstrodtman

@dstrodtman dstrodtman commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

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

dstrodtman and others added 2 commits September 30, 2026 12:07
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]>
@dstrodtman
dstrodtman marked this pull request as ready for review September 30, 2026 16:24
@dstrodtman
dstrodtman requested review from a team as code owners September 30, 2026 16:24
@dstrodtman dstrodtman added the go add ONLY when ready to merge, run all tests label Sep 30, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}%")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
MYST_COMMENT_RE = re.compile(r"^\s{0,3}%")
MYST_COMMENT_RE = re.compile(r"^\s*%")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +375 to +379
(
"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",
),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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",
    ),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, applied in 6449e11.

dstrodtman added a commit that referenced this pull request Sep 30, 2026
## 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]>
dstrodtman and others added 2 commits September 30, 2026 12:47
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]>
@dstrodtman
dstrodtman merged commit c2a1916 into master Sep 30, 2026
5 of 6 checks passed
@dstrodtman
dstrodtman deleted the djs-260930-soft-wrap-docs branch September 30, 2026 16:54
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
## 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]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants