Skip to content

[docs] Remove duplicate toctree parents from API reference pages - #66757

Merged
dstrodtman merged 7 commits into
masterfrom
doc-1651-dedupe-toctrees
Oct 7, 2026
Merged

dstrodtman merged 7 commits into
masterfrom
doc-1651-dedupe-toctrees

Conversation

@dstrodtman

@dstrodtman dstrodtman commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Why are these changes needed?

Stacked on #66744.

A Sphinx build of master logs 265 document is referenced in multiple toctrees messages. They're info-level, so they don't fail the build, but every one marks a page whose sidebar parent and breadcrumb Sphinx has to choose arbitrarily. This PR removes 245 of them. The other 20 are on Ray Core API pages and are left for separate follow-ups.

Autosummary entries listed twice (240)

Most duplicates come from a hand-written API page that lists a class with :toctree: doc/ and then lists that class's methods in further :toctree: blocks. The class stub, rendered from _templates/autosummary/class.rst, already lists every documented method in its own :toctree: autosummary, so each method stub ends up with two parents. Similarly, train/api/deprecated.rst re-lists APIs that the Train API pages also list, and data/api/saving_data.rst re-lists Dataset methods that the Dataset page owns.

The fix drops :toctree: from the duplicated entries only. The tables still render and link to the same stub pages, since autosummary links entries by object reference. The stubs are still generated, because autosummary recurses into generated stubs and the class stub's own :toctree: block covers them. Where a block mixed duplicated and unique entries, it's split into consecutive blocks in the original order, so only the duplicated runs lose :toctree:. That split adds a small gap between table rows on a few pages, for example Learner / Learner.build / Learner._make_module in the RLlib Learner reference.

Files: RLlib package_ref (12 pages), Tune api (9 pages), Data saving_data and preprocessor, Train deprecated.

Hand-written navigation duplicates (3 pages)

  • cluster/vms/user-guides/community/index.md had a hidden toctree repeating yarn, slurm, and lsf from the visible toctree below it. Removed the hidden one.
  • ray-references/faq.md, an orphan page, listed tune/faq in a toctree that competed with tune/index. It's now a plain {doc} link.
  • ray-observability/ray-distributed-debugger.md sat in both ray-observability/index.md and user-guides/debug-apps/index.md. Kept it in the top-level observability toctree, which matches the file's location, and removed it from the debug-apps toctree. The debug-apps page still links it from its bullet list. Reviewer call: if the debugger should live under Debugging Applications in the sidebar instead, flip which toctree keeps it.

Left for follow-ups (20)

These were deferred while #66605 (Ray Core directory move) and #66751 (API reference page moves) were in flight. Both have merged, and the duplicates remain on the moved pages:

  • 13 come from [doc][core] Move four API reference pages into the Ray Core API section #66751 keeping each moved page in its original section's toctree as well as in core/api/index.md: core/api/job-submission.md and its eight JobSubmissionClient method stubs, job-submission/cli.md, core/api/autoscaler.md, core/api/compiled-graph.rst, and the ActorMethod.bind stub. Whether those pages keep a second home in their original sections is a navigation decision for that change, not a mechanical fix.
  • 2 are core/api/state.rst and ray-observability/reference/cli.rst, listed from both the observability reference index and the Core API index.
  • 5 are Core API stubs listed twice within core/api/: ray.get, ray.put, and ray.method (core and direct-transport), ActorClass.options (the ActorClass stub and core), and ray.remote (twice in core).

Related issue number

None.

Checks

This PR was prepared with AI assistance (Claude Code).

🤖 Generated with Claude Code

dstrodtman and others added 4 commits October 5, 2026 15:52
… pages

The Serve and Train API landing pages were monolithic content pages with
every autosummary table inline, so the APIs tab sidebar listed 109 Serve
and 61 Train symbols flat, with no grouping. Ambiguous names such as
RayTrainReportCallback appeared four times with no framework context.

Split both into hub landing pages with one sub-page per public API group,
following the public module each API is imported from (for example
ray.serve.config, ray.serve.schema, ray.train.torch, ray.train.lightning).
Autosummary entries, templates, and `doc/` stub paths are unchanged, so
every per-symbol URL stays the same, and all existing labels move with
their content.

Align all six library API landing pages on one shape: a description, a
label, an H1, a one-sentence intro, and a toctree of groups.

Also repoint the /serve/llm/api.html redirect at the new LLM API page and
add the new thin API group pages to llms_txt_exclude, matching the
existing treatment of thin API hub pages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
Sphinx logs "document is referenced in multiple toctrees" when two
toctrees list the same document. Most cases come from a hand-written API
page whose autosummary block uses :toctree: for methods that the class
stub's own autosummary already lists. Drop :toctree: from those entries
so the class stub is the only parent. The entries still link to the same
stub pages.

Also remove three hand-written duplicates: a hidden toctree that repeats
the visible one on the community cluster managers page, the Tune FAQ
listed from the orphan ray-references/faq page, and the distributed
debugger listed from both the observability and debug-apps indexes.

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 October 6, 2026 18:57
@dstrodtman
dstrodtman requested review from a team as code owners October 6, 2026 18:57

@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 cleans up and restructures Sphinx documentation API reference files. It removes or splits the :toctree: doc/ option in numerous .. autosummary:: directives across various .rst files (including data, rllib, train, and tune APIs) to control sub-page generation. Additionally, it simplifies markdown table of contents (toctree) entries and links in several .md files. As there are no review comments, I have no feedback to provide.

… pages

The Serve and Train API landing pages were monolithic content pages with
every autosummary table inline, so the APIs tab sidebar listed 109 Serve
and 61 Train symbols flat, with no grouping. Ambiguous names such as
RayTrainReportCallback appeared four times with no framework context.

Split both into hub landing pages with one sub-page per public API group,
following the public module each API is imported from (for example
ray.serve.config, ray.serve.schema, ray.train.torch, ray.train.lightning).
Autosummary entries, templates, and `doc/` stub paths are unchanged, so
every per-symbol URL stays the same, and all existing labels move with
their content.

Align all six library API landing pages on one shape: a description, a
label, an H1, a one-sentence intro, and a toctree of groups.

Also repoint the /serve/llm/api.html redirect at the new LLM API page and
add the new thin API group pages to llms_txt_exclude, matching the
existing treatment of thin API hub pages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman
dstrodtman force-pushed the doc-1651-api-landing-pages branch from 8124504 to c35d392 Compare October 6, 2026 19:03
@dstrodtman
dstrodtman requested a review from a team as a code owner October 6, 2026 19:03
dstrodtman and others added 2 commits October 6, 2026 15:41
…ing-pages

Signed-off-by: Douglas Strodtman <[email protected]>

# Conflicts:
#	doc/source/conf.py
Resolve conflicts from the earlier base merge to the base branch version.
This branch now differs from its base only in the 27 files from the
toctree dedupe commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
Base automatically changed from doc-1651-api-landing-pages to master October 6, 2026 20:45
@dstrodtman dstrodtman added the go add ONLY when ready to merge, run all tests label Oct 7, 2026
@dstrodtman
dstrodtman merged commit ec39859 into master Oct 7, 2026
6 checks passed
@dstrodtman
dstrodtman deleted the doc-1651-dedupe-toctrees branch October 7, 2026 12:46
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