Skip to content

[rllib] Convert the RLlib index and RL Modules pages to MyST Markdown - #66216

Merged
dstrodtman merged 1 commit into
doc-1528-rllib-myst-convertfrom
doc-1528-rllib-convert-prose-pages
Sep 17, 2026
Merged

dstrodtman merged 1 commit into
doc-1528-rllib-myst-convertfrom
doc-1528-rllib-convert-prose-pages

Conversation

@dstrodtman

Copy link
Copy Markdown
Contributor

Why

RLlib's user-guide pages are moving from reStructuredText to MyST Markdown, the standard for new Ray docs. This converts the next two non-prefixed pages — the RLlib landing page (index) and the RL Modules guide (rl-modules) — and takes the opportunity to decouple the RLlib package README from the doc source.

This stacks on the conversion layer (#66062). Its files are disjoint from the pages converted there, and these two pages carry no rllib- filename prefix, so unlike that stack there's no rename layer beneath this — the URLs don't change.

What

Format-only conversion. Rendered HTML is preserved, so published URLs and page content stay the same (Sphinx maps .rst and .md to the same .html). No rewording, no restructuring, no heading-level changes. Source line-wrapping is preserved verbatim so the diff stays line-aligned with the .rst; the soft-wrap reflow is deferred to a later layer, matching #66062 / #66214.

  • doc/source/rllib/index.rst → index.md and doc/source/rllib/rl-modules.rst → rl-modules.md.
  • rllib/README.rst → rllib/README.md, rewritten as self-contained GitHub-flavored Markdown (details below).
  • One sibling-link fix in doc/source/ray-overview/getting-started.md ([RLlib](../rllib/index.rst) → {doc}).

Construct notes for review

  • Sigil substitution tables (index). The two collapsible previews (Algorithms and Environments) were RST grid tables driven by |single_agent|-style image substitutions. The substitution MyST extension is off, and wrapping a substitution in {eval-rst} doesn't rescue it (docutils raises Undefined substitution referenced). Since html_image is on, each becomes a {list-table} with inline <img> cells — the same pattern algorithms.md already uses. Two consequences worth a look:
    • Section rows (On-Policy, Off-Policy, …) render as bold labels rather than full-width bands, because MyST list-tables can't span columns.
    • The Environments table keeps its per-row bash/python snippets as fenced code inside the list-table cells.
  • README decoupling. rllib/README.rst used .. include:: to splice three marker-delimited sections out of index.rst. That file isn't in the Sphinx build, and python/setup.py's long_description uses the repo-root README.rst, not this one — and GitHub doesn't execute RST includes — so the includes rendered nothing anywhere. The new README.md carries the tagline, install, a quickstart, a docs link, and the citations directly. The now-defunct sphinx_rllib_readme_* markers are dropped from index.md.
  • Shared include dropped. The .. include:: /_includes/rllib/new_api_stack.rst line is dropped from both pages. That partial is all-comment and renders nothing under RST; a MyST {include} of an .rst partial would surface its raw text instead.
  • Executed doctest. {testcode} counts match the originals (3 in index, 16 in rl-modules). The doctest[rllib] target globs *.md and neither file is individually excluded, so coverage carries over with no doc/BUILD.bazel change. These blocks already executed as .rst on master.
  • literalinclude paths preserved byte-for-byte — the ../../../rllib/... code-tree includes in rl-modules. If the RLlib source-tree move lands while this is open, coordinate merge order on rl-modules.md.
  • rl-modules keeps a large author .. TODO: comment (the parametric-actions section) verbatim inside an HTML comment — it renders nothing, as before.

Links repointed (called out)

  • index: env.html#multi-agent-and-hierarchical was a moved anchor; it now targets the Multi-Agent Environments page ({ref} to rllib-multi-agent-environments-doc), the same target env.md uses. env.html#configuring-environments → {ref} to the live label on env.md.
  • ray-overview/getting-started.md: the sibling [RLlib](../rllib/index.rst) link → {doc} so it survives the rename.

Verification

  • Static checks pass on both new pages: fenced and colon fences balance, no residual RST outside fences, every label preserved, executed-directive counts match, no conversion-agent scaffolding leaked.
  • The decisive check is the Read the Docs preview (fail_on_warning) and the render diff against /en/master; I'll confirm both on this PR's preview build and post any surviving, explainable diffs. The list-table-with-<img> previews and the code-in-cell Environments table are the constructs to watch there.

🤖 Generated with Claude Code

@dstrodtman
dstrodtman requested review from a team as code owners September 16, 2026 21:16

@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 migrates several RLlib documentation files from reStructuredText (.rst) to MyST Markdown (.md), including the main index, the RL Modules guide, and the RLlib README. It also updates references to use the Sphinx {doc} role. The review feedback identifies a couple of minor issues in the newly added doc/source/rllib/index.md file: a typo in the class path default_model_cnofig (which should be default_model_config) and trailing backticks in a pip install code block.

Comment thread doc/source/rllib/index.md
In `config.env_runners()` you can specify - amongst many other things - the number of parallel
{py:class}`~ray.rllib.env.env_runner.EnvRunner` actors to collect samples from the environment.

You can also tweak the NN architecture used by tweaking RLlib's {py:class}`~ray.rllib.core.rl_module.default_model_cnofig.DefaultModelConfig`,

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

There is a typo in the class path: default_model_cnofig should be default_model_config.

Comment thread doc/source/rllib/index.md
* - [gymnasium](https://gymnasium.farama.org/index.html) <img src="images/sigils/single-agent.svg" class="inline-figure" width="72" alt="single_agent">

```bash
pip install "gymnasium[atari,accept-rom-license,mujoco]"``

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

There are trailing backticks at the end of the command inside the code block, which is a syntax error.

Suggested change
pip install "gymnasium[atari,accept-rom-license,mujoco]"``
pip install "gymnasium[atari,accept-rom-license,mujoco]"

@ray-gardener ray-gardener Bot added rllib RLlib related issues docs An issue or change related to documentation labels Sep 17, 2026
Converts two RLlib guide pages from reStructuredText to MyST Markdown, the
standard for new Ray doc pages, and decouples the RLlib package README from the
doc source. Format only: rendered HTML is preserved, so published URLs and page
content stay the same. This is a follow-on conversion layer for the remaining
non-prefixed RLlib pages, disjoint from the pages already converted in the
parent branch.

- `index.rst` -> `index.md` and `rl-modules.rst` -> `rl-modules.md`. Faithful
  syntax conversion: no rewording, no restructuring, no heading-level changes.
  Source line-wrapping is preserved verbatim so the diff stays line-aligned with
  the `.rst`; the soft-wrap reflow is a separate layer.

- The two `|sigil|` substitution tables in `index.md` (the collapsible
  Algorithms and Environments previews) become `{list-table}`s with `<img>`
  cells. The `substitution` MyST extension is off, so an RST `|name|`
  substitution can't resolve and can't be rescued inside an `{eval-rst}` block;
  the `html_image` extension is on, so inline `<img>` in a list-table cell is the
  supported form. Section rows render as bold labels rather than full-width
  bands, since MyST list-tables can't span columns.

- `rllib/README.rst` -> `rllib/README.md`, rewritten as self-contained
  GitHub-flavored Markdown. The old README `.. include::`d three marker-delimited
  sections out of `index.rst`; GitHub doesn't execute RST includes and the file
  isn't part of the Sphinx build or the package long_description
  (`python/setup.py` uses the repo-root `README.rst`), so the includes rendered
  nothing. The new README carries the tagline, install, a quickstart, a docs
  link, and the citations directly. The now-defunct `sphinx_rllib_readme_*`
  markers are dropped from `index.md`.

- The shared `.. include:: /_includes/rllib/new_api_stack.rst` partial is dropped
  from both pages. It's an all-comment partial that renders nothing under RST; a
  MyST `{include}` of an `.rst` partial surfaces its raw text instead.

- Repointed one moved link: `index`'s `env.html#multi-agent-and-hierarchical`
  now targets the Multi-Agent Environments page (`rllib-multi-agent-environments-doc`),
  the same target `env.md` uses. Fixed `env.html#configuring-environments` to a
  `{ref}` and a sibling `[RLlib](../rllib/index.rst)` link in
  `ray-overview/getting-started.md` to `{doc}`.

Executed `{testcode}` counts match the originals (3 in `index`, 16 in
`rl-modules`); the `doctest[rllib]` target globs `*.md`, so coverage carries
over with no `doc/BUILD.bazel` change. The `../../../rllib/...` code-tree
`literalinclude` paths in `rl-modules` are preserved byte-for-byte.

Signed-off-by: Douglas Strodtman <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
@dstrodtman
dstrodtman force-pushed the doc-1528-rllib-convert-prose-pages branch from eadd0ba to 87401a4 Compare September 17, 2026 12:32
dstrodtman added a commit that referenced this pull request Sep 17, 2026
…e smaller traps

Adds four items found converting the RLlib index and rl-modules pages:

- Hard rule 2 gains a fourth "translate, don't transcribe" link form: an RST
  target with no URL scheme (`<pytorch.org>`) transcribes cleanly to
  `[text](pytorch.org)`, which MyST reads as a cross-reference, not a URL, and
  fails the build with myst.xref_missing. This is the worst kind of gap because
  it looks faithful and passes a glance -- it was latent in the already-merged
  multi-agent-envs.md conversion and silently red-built the stack until the RtD
  preview caught it. Verification step 1 gains a grep that flags it before the
  build.
- Pre-flight's "who references THIS file" grep is widened past doc/ for a
  landing/index page: rllib/index.rst was `.. include::`d by rllib/README.rst,
  a package README outside the Sphinx build that a doc/-scoped grep never sees.
- A construct note documents the RST-comment -> HTML-comment convention the
  merged pages already follow, and that the render diff flags it as benign.

Surfaced by #66216.

Signed-off-by: Douglas Strodtman <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
@dstrodtman
dstrodtman merged commit 8599a87 into doc-1528-rllib-myst-convert Sep 17, 2026
4 of 5 checks passed
@dstrodtman
dstrodtman deleted the doc-1528-rllib-convert-prose-pages branch September 17, 2026 13:58
dstrodtman added a commit that referenced this pull request Sep 18, 2026
…#66216)

RLlib's user-guide pages are moving from reStructuredText to MyST
Markdown, the standard for new Ray docs. This converts the next two
non-prefixed pages — the RLlib landing page (`index`) and the RL Modules
guide (`rl-modules`) — and takes the opportunity to decouple the RLlib
package README from the doc source.

This stacks on the conversion layer (#66062). Its files are disjoint
from the pages converted there, and these two pages carry no `rllib-`
filename prefix, so unlike that stack there's no rename layer beneath
this — the URLs don't change.

Format-only conversion. Rendered HTML is preserved, so published URLs
and page content stay the same (Sphinx maps `.rst` and `.md` to the same
`.html`). No rewording, no restructuring, no heading-level changes.
Source line-wrapping is preserved verbatim so the diff stays
line-aligned with the `.rst`; the soft-wrap reflow is deferred to a
later layer, matching #66062 / #66214.

- **`doc/source/rllib/index.rst` → `index.md`** and
**`doc/source/rllib/rl-modules.rst` → `rl-modules.md`**.
- **`rllib/README.rst` → `rllib/README.md`**, rewritten as
self-contained GitHub-flavored Markdown (details below).
- One sibling-link fix in `doc/source/ray-overview/getting-started.md`
(`[RLlib](../rllib/index.rst)` → `{doc}`).

- **Sigil substitution tables (`index`).** The two collapsible previews
(Algorithms and Environments) were RST grid tables driven by
`|single_agent|`-style image substitutions. The `substitution` MyST
extension is off, and wrapping a substitution in `{eval-rst}` doesn't
rescue it (docutils raises `Undefined substitution referenced`). Since
`html_image` is on, each becomes a `{list-table}` with inline `<img>`
cells — the same pattern `algorithms.md` already uses. Two consequences
worth a look:
- Section rows (**On-Policy**, **Off-Policy**, …) render as bold labels
rather than full-width bands, because MyST list-tables can't span
columns.
- The Environments table keeps its per-row `bash`/`python` snippets as
fenced code inside the list-table cells.
- **README decoupling.** `rllib/README.rst` used `.. include::` to
splice three marker-delimited sections out of `index.rst`. That file
isn't in the Sphinx build, and `python/setup.py`'s `long_description`
uses the repo-root `README.rst`, not this one — and GitHub doesn't
execute RST includes — so the includes rendered nothing anywhere. The
new `README.md` carries the tagline, install, a quickstart, a docs link,
and the citations directly. The now-defunct `sphinx_rllib_readme_*`
markers are dropped from `index.md`.
- **Shared include dropped.** The `.. include::
/_includes/rllib/new_api_stack.rst` line is dropped from both pages.
That partial is all-comment and renders nothing under RST; a MyST
`{include}` of an `.rst` partial would surface its raw text instead.
- **Executed doctest.** `{testcode}` counts match the originals (3 in
`index`, 16 in `rl-modules`). The `doctest[rllib]` target globs `*.md`
and neither file is individually excluded, so coverage carries over with
no `doc/BUILD.bazel` change. These blocks already executed as `.rst` on
master.
- **`literalinclude` paths preserved byte-for-byte** — the
`../../../rllib/...` code-tree includes in `rl-modules`. If the RLlib
source-tree move lands while this is open, coordinate merge order on
`rl-modules.md`.
- **`rl-modules`** keeps a large author `.. TODO:` comment (the
parametric-actions section) verbatim inside an HTML comment — it renders
nothing, as before.

- `index`: `env.html#multi-agent-and-hierarchical` was a moved anchor;
it now targets the Multi-Agent Environments page (`{ref}` to
`rllib-multi-agent-environments-doc`), the same target `env.md` uses.
`env.html#configuring-environments` → `{ref}` to the live label on
`env.md`.
- `ray-overview/getting-started.md`: the sibling
`[RLlib](../rllib/index.rst)` link → `{doc}` so it survives the rename.

- Static checks pass on both new pages: fenced and colon fences balance,
no residual RST outside fences, every label preserved,
executed-directive counts match, no conversion-agent scaffolding leaked.
- **The decisive check is the Read the Docs preview**
(`fail_on_warning`) and the render diff against `/en/master`; I'll
confirm both on this PR's preview build and post any surviving,
explainable diffs. The list-table-with-`<img>` previews and the
code-in-cell Environments table are the constructs to watch there.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs An issue or change related to documentation rllib RLlib related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant