Skip to content

[doc] fix sphinx-sitemap output across versions - #63115

Merged
elliot-barn merged 5 commits into
ray-project:masterfrom
dstrodtman:doc-867-sitemap-fix
May 5, 2026
Merged

elliot-barn merged 5 commits into
ray-project:masterfrom
dstrodtman:doc-867-sitemap-fix

Conversation

@dstrodtman

Copy link
Copy Markdown
Contributor

Why

https://docs.ray.io/sitemap.xml (and the per-version sitemaps under /en/<version>/sitemap.xml) currently emit URLs of the form https://docs.ray.io/en/latesten/<page> and 404 across every Ray docs version. Sitemap-driven discovery is dead at every version. This is a long-standing miscombination of two configuration bugs:

  1. html_baseurl lacks a trailing slash: "https://docs.ray.io/en/latest".
  2. sphinx-sitemap's default sitemap_url_scheme = "{lang}{version}{link}" prepends en/ to every page path because language = "en" is set in conf.py. But html_baseurl already encodes /en/latest/. So the language gets doubled.

Both combine to produce /en/latest + en/ + <page> = /en/latesten/<page>.

What

  • Add trailing slash to html_baseurl.
  • Override sitemap_url_scheme = "{link}" so the language and version aren't doubled. Inline comment in conf.py explains why.
  • Bump sphinx-sitemap from 2.5.1 to 2.9.0 (lock file updated to match). The scheme override is the load-bearing fix; the version bump is hygiene.

Verification

After this lands and latest rebuilds, the expected outcome is:

  • https://docs.ray.io/sitemap.xml returns 200 with URLs that resolve.
  • A spot check of any 5-10 entries from the sitemap returns 200, not 404.
  • Per-version archives' sitemaps remain broken (they're frozen and not rebuilt). RtD serves a single top-level sitemap from the default version's build output, so legacy archives' sitemaps are crawler-irrelevant once latest is fixed.

Context

Tracked under DOC-867 in anyscale/docs Jira (private). Part of a broader rebuild-free legacy-version fix sweep (DOC-849). Strategy context lives in anyscale/docs:strategy/ray-docs/legacy-versions-aeo.md sections 3 (symptom audit) and 12 (rebuild-vs-no-rebuild dispatch).

Risks

  • The sitemap_url_scheme = "{link}" override is unambiguous given the current html_baseurl shape. If html_baseurl is ever changed to omit /en/<version>/, the scheme would need to revert to the default to re-include language/version. Captured in the conf.py comment.
  • Dependency lock file was edited directly with the new wheel/sdist hashes from PyPI (sphinx-sitemap 2.9.0 has the same transitive dependency surface as 2.5.1). If raydepsets regeneration is preferred, the lock will be re-resolved cleanly.

Two compounding bugs were producing broken sitemap URLs of the form
`https://docs.ray.io/en/latesten/<page>` on every Ray docs version:

1. `html_baseurl` lacked a trailing slash, so the language prefix
   ran together with the path: `/en/latest` + `en/` -> `/en/latesten/`.
2. sphinx-sitemap's default `sitemap_url_scheme = "{lang}{version}{link}"`
   prepends `en/` to every page path because `language = "en"` is set,
   but `html_baseurl` already encodes `/en/latest/`. So the language
   was doubled.

Fix:
- Add trailing slash to `html_baseurl`.
- Override `sitemap_url_scheme = "{link}"` so lang/version isn't doubled.
- Bump sphinx-sitemap from 2.5.1 to 2.9.0 (lock file updated to match).
  The override is the load-bearing fix; the version bump is hygiene.

Once `latest` rebuilds, `https://docs.ray.io/sitemap.xml` should
return real URLs that resolve, restoring sitemap-driven discovery
across the site.

DOC-867 in anyscale/docs Jira tracking. Diagnosis context:
anyscale/docs:strategy/ray-docs/legacy-versions-aeo.md sections 3 and 12.

Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman
dstrodtman requested a review from a team as a code owner May 4, 2026 21:03
sphinx-sitemap 2.9.0 added sphinx-last-updated-by-git as a transitive
dependency. The previous lock-file edit (which manually added the
sphinx-sitemap 2.9.0 hashes) didn't carry the new transitive, so
RtD's --require-hashes pip install rejected the unpinned dep with:

  ERROR: In --require-hashes mode, all requirements must have their
  versions pinned with ==. These do not:
      sphinx-last-updated-by-git from ...

Adds sphinx-last-updated-by-git==0.3.8 with both wheel and sdist
hashes from PyPI. Its only runtime dep is sphinx>=1.8, which is
already pinned in the lock, so no further transitive entries needed.

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

@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 upgrades the sphinx-sitemap dependency to version 2.9.0 and updates the documentation configuration to correctly handle URL generation by adding a trailing slash to html_baseurl and overriding the sitemap_url_scheme. I have no further feedback to provide as the changes are well-justified.

@ray-gardener ray-gardener Bot added docs An issue or change related to documentation core Issues that should be addressed in Ray Core labels May 5, 2026
@dstrodtman dstrodtman added the go add ONLY when ready to merge, run all tests label May 5, 2026
raydepsets reported the lock file out of date in CI because the
manual `sphinx-last-updated-by-git` addition didn't update the
`# via` comment block of `sphinx==7.3.7`.

In the canonical resolved graph for sphinx-sitemap 2.9.0:
  sphinx-sitemap -> sphinx-last-updated-by-git -> sphinx

So sphinx's via list now includes sphinx-last-updated-by-git
(direct parent of sphinx) and no longer includes sphinx-sitemap
(now an indirect parent through sphinx-last-updated-by-git).

Comment-only change matching the diff raydepsets produced. No
package versions or hashes affected.

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

@ronny-anyscale ronny-anyscale 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.

pow!

@elliot-barn
elliot-barn merged commit 3201e48 into ray-project:master May 5, 2026
3 checks passed
elliot-barn pushed a commit that referenced this pull request May 5, 2026
…63130)

## Why

Read the Docs serves `/llms.txt` and `/llms-full.txt` automatically from
the default version's build output once those files are present. Ray
docs don't currently emit them, so `https://docs.ray.io/llms.txt` 404s.
This is the largest remaining agent-facing gap on `docs.ray.io` per
Anyscale's agent-friendliness assessment.

## What

Adds the
[`sphinx-llms-txt`](https://github.com/jdillard/sphinx-llms-txt)
extension so Sphinx generates `llms.txt` and `llms-full.txt` at build
time. RtD then serves them at the domain root with no further config.

Three files changed:

- `doc/requirements-doc.txt`: add `sphinx-llms-txt==0.7.1`.
- `doc/source/conf.py`: add `sphinx_llms_txt` to the `extensions` list.
- `python/deplocks/docs/docbuild_depset_py3.10.lock`: package entry plus
via-comment update on the `sphinx` package. The extension's only runtime
dep is `sphinx`, already pinned, so no further transitives.

## Verification

After this lands and `latest` rebuilds, the expected outcome:

- `https://docs.ray.io/llms.txt` returns 200 with a markdown summary of
the doc structure.
- `https://docs.ray.io/llms-full.txt` returns 200 with the full corpus
in reStructuredText.
- Spot-check the generated `llms.txt` to confirm headers and links look
sane.

## Extension diligence

Picked `sphinx-llms-txt` (MIT) as the lighter shipping path. Active
maintenance: 11 releases since May 2025, last commit March 2026.
External contributors have landed PRs from Google (`kaycebasques`) and
NVIDIA (`jacobtomlinson`). 30+ Python OSS projects use it including
`scrapy/scrapy`, `apache/hamilton`, `plone/documentation`,
`pola-rs/polars-cloud-client`, `NVIDIA-NeMo/Evaluator`,
`wagtail/sphinx-wagtail-theme`, `requests-cache/requests-cache`,
`pyrogram`.

The heavier sibling
[`NVIDIA/sphinx-llm`](https://github.com/NVIDIA/sphinx-llm) (Apache 2.0)
also emits per-page markdown twins. The two extensions are designed to
be complementary; we can adopt `sphinx-llm` later as a follow-up if
per-page twins become worthwhile.

## Context

Tracked under `DOC-875` in the anyscale/docs Jira (private). Part of a
broader rebuild-free legacy-version fix sweep (`DOC-849`). Lives
alongside the recent sphinx-sitemap fix in #63115.

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Lucas61000 pushed a commit to Lucas61000/ray that referenced this pull request May 15, 2026
## Why

`https://docs.ray.io/sitemap.xml` (and the per-version sitemaps under
`/en/<version>/sitemap.xml`) currently emit URLs of the form
`https://docs.ray.io/en/latesten/<page>` and 404 across every Ray docs
version. Sitemap-driven discovery is dead at every version. This is a
long-standing miscombination of two configuration bugs:

1. `html_baseurl` lacks a trailing slash:
`"https://docs.ray.io/en/latest"`.
2. sphinx-sitemap's default `sitemap_url_scheme =
"{lang}{version}{link}"` prepends `en/` to every page path because
`language = "en"` is set in `conf.py`. But `html_baseurl` already
encodes `/en/latest/`. So the language gets doubled.

Both combine to produce `/en/latest` + `en/` + `<page>` =
`/en/latesten/<page>`.

## What

- Add trailing slash to `html_baseurl`.
- Override `sitemap_url_scheme = "{link}"` so the language and version
aren't doubled. Inline comment in `conf.py` explains why.
- Bump `sphinx-sitemap` from 2.5.1 to 2.9.0 (lock file updated to
match). The scheme override is the load-bearing fix; the version bump is
hygiene.

## Verification

After this lands and `latest` rebuilds, the expected outcome is:

- `https://docs.ray.io/sitemap.xml` returns 200 with URLs that resolve.
- A spot check of any 5-10 entries from the sitemap returns 200, not
404.
- Per-version archives' sitemaps remain broken (they're frozen and not
rebuilt). RtD serves a single top-level sitemap from the default
version's build output, so legacy archives' sitemaps are
crawler-irrelevant once `latest` is fixed.

## Context

Tracked under `DOC-867` in anyscale/docs Jira (private). Part of a
broader rebuild-free legacy-version fix sweep (`DOC-849`). Strategy
context lives in
`anyscale/docs:strategy/ray-docs/legacy-versions-aeo.md` sections 3
(symptom audit) and 12 (rebuild-vs-no-rebuild dispatch).

## Risks

- The `sitemap_url_scheme = "{link}"` override is unambiguous given the
current `html_baseurl` shape. If `html_baseurl` is ever changed to omit
`/en/<version>/`, the scheme would need to revert to the default to
re-include language/version. Captured in the conf.py comment.
- Dependency lock file was edited directly with the new wheel/sdist
hashes from PyPI (sphinx-sitemap 2.9.0 has the same transitive
dependency surface as 2.5.1). If `raydepsets` regeneration is preferred,
the lock will be re-resolved cleanly.

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Lucas61000 pushed a commit to Lucas61000/ray that referenced this pull request May 15, 2026
…ay-project#63130)

## Why

Read the Docs serves `/llms.txt` and `/llms-full.txt` automatically from
the default version's build output once those files are present. Ray
docs don't currently emit them, so `https://docs.ray.io/llms.txt` 404s.
This is the largest remaining agent-facing gap on `docs.ray.io` per
Anyscale's agent-friendliness assessment.

## What

Adds the
[`sphinx-llms-txt`](https://github.com/jdillard/sphinx-llms-txt)
extension so Sphinx generates `llms.txt` and `llms-full.txt` at build
time. RtD then serves them at the domain root with no further config.

Three files changed:

- `doc/requirements-doc.txt`: add `sphinx-llms-txt==0.7.1`.
- `doc/source/conf.py`: add `sphinx_llms_txt` to the `extensions` list.
- `python/deplocks/docs/docbuild_depset_py3.10.lock`: package entry plus
via-comment update on the `sphinx` package. The extension's only runtime
dep is `sphinx`, already pinned, so no further transitives.

## Verification

After this lands and `latest` rebuilds, the expected outcome:

- `https://docs.ray.io/llms.txt` returns 200 with a markdown summary of
the doc structure.
- `https://docs.ray.io/llms-full.txt` returns 200 with the full corpus
in reStructuredText.
- Spot-check the generated `llms.txt` to confirm headers and links look
sane.

## Extension diligence

Picked `sphinx-llms-txt` (MIT) as the lighter shipping path. Active
maintenance: 11 releases since May 2025, last commit March 2026.
External contributors have landed PRs from Google (`kaycebasques`) and
NVIDIA (`jacobtomlinson`). 30+ Python OSS projects use it including
`scrapy/scrapy`, `apache/hamilton`, `plone/documentation`,
`pola-rs/polars-cloud-client`, `NVIDIA-NeMo/Evaluator`,
`wagtail/sphinx-wagtail-theme`, `requests-cache/requests-cache`,
`pyrogram`.

The heavier sibling
[`NVIDIA/sphinx-llm`](https://github.com/NVIDIA/sphinx-llm) (Apache 2.0)
also emits per-page markdown twins. The two extensions are designed to
be complementary; we can adopt `sphinx-llm` later as a follow-up if
per-page twins become worthwhile.

## Context

Tracked under `DOC-875` in the anyscale/docs Jira (private). Part of a
broader rebuild-free legacy-version fix sweep (`DOC-849`). Lives
alongside the recent sphinx-sitemap fix in ray-project#63115.

---------

Signed-off-by: Douglas Strodtman <[email protected]>
alexandrplashchinsky pushed a commit to alexandrplashchinsky/ray-alex that referenced this pull request May 29, 2026
## Why

`https://docs.ray.io/sitemap.xml` (and the per-version sitemaps under
`/en/<version>/sitemap.xml`) currently emit URLs of the form
`https://docs.ray.io/en/latesten/<page>` and 404 across every Ray docs
version. Sitemap-driven discovery is dead at every version. This is a
long-standing miscombination of two configuration bugs:

1. `html_baseurl` lacks a trailing slash:
`"https://docs.ray.io/en/latest"`.
2. sphinx-sitemap's default `sitemap_url_scheme =
"{lang}{version}{link}"` prepends `en/` to every page path because
`language = "en"` is set in `conf.py`. But `html_baseurl` already
encodes `/en/latest/`. So the language gets doubled.

Both combine to produce `/en/latest` + `en/` + `<page>` =
`/en/latesten/<page>`.

## What

- Add trailing slash to `html_baseurl`.
- Override `sitemap_url_scheme = "{link}"` so the language and version
aren't doubled. Inline comment in `conf.py` explains why.
- Bump `sphinx-sitemap` from 2.5.1 to 2.9.0 (lock file updated to
match). The scheme override is the load-bearing fix; the version bump is
hygiene.

## Verification

After this lands and `latest` rebuilds, the expected outcome is:

- `https://docs.ray.io/sitemap.xml` returns 200 with URLs that resolve.
- A spot check of any 5-10 entries from the sitemap returns 200, not
404.
- Per-version archives' sitemaps remain broken (they're frozen and not
rebuilt). RtD serves a single top-level sitemap from the default
version's build output, so legacy archives' sitemaps are
crawler-irrelevant once `latest` is fixed.

## Context

Tracked under `DOC-867` in anyscale/docs Jira (private). Part of a
broader rebuild-free legacy-version fix sweep (`DOC-849`). Strategy
context lives in
`anyscale/docs:strategy/ray-docs/legacy-versions-aeo.md` sections 3
(symptom audit) and 12 (rebuild-vs-no-rebuild dispatch).

## Risks

- The `sitemap_url_scheme = "{link}"` override is unambiguous given the
current `html_baseurl` shape. If `html_baseurl` is ever changed to omit
`/en/<version>/`, the scheme would need to revert to the default to
re-include language/version. Captured in the conf.py comment.
- Dependency lock file was edited directly with the new wheel/sdist
hashes from PyPI (sphinx-sitemap 2.9.0 has the same transitive
dependency surface as 2.5.1). If `raydepsets` regeneration is preferred,
the lock will be re-resolved cleanly.

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Signed-off-by: Alexandr Plashchinsky <[email protected]>
alexandrplashchinsky pushed a commit to alexandrplashchinsky/ray-alex that referenced this pull request May 29, 2026
…ay-project#63130)

## Why

Read the Docs serves `/llms.txt` and `/llms-full.txt` automatically from
the default version's build output once those files are present. Ray
docs don't currently emit them, so `https://docs.ray.io/llms.txt` 404s.
This is the largest remaining agent-facing gap on `docs.ray.io` per
Anyscale's agent-friendliness assessment.

## What

Adds the
[`sphinx-llms-txt`](https://github.com/jdillard/sphinx-llms-txt)
extension so Sphinx generates `llms.txt` and `llms-full.txt` at build
time. RtD then serves them at the domain root with no further config.

Three files changed:

- `doc/requirements-doc.txt`: add `sphinx-llms-txt==0.7.1`.
- `doc/source/conf.py`: add `sphinx_llms_txt` to the `extensions` list.
- `python/deplocks/docs/docbuild_depset_py3.10.lock`: package entry plus
via-comment update on the `sphinx` package. The extension's only runtime
dep is `sphinx`, already pinned, so no further transitives.

## Verification

After this lands and `latest` rebuilds, the expected outcome:

- `https://docs.ray.io/llms.txt` returns 200 with a markdown summary of
the doc structure.
- `https://docs.ray.io/llms-full.txt` returns 200 with the full corpus
in reStructuredText.
- Spot-check the generated `llms.txt` to confirm headers and links look
sane.

## Extension diligence

Picked `sphinx-llms-txt` (MIT) as the lighter shipping path. Active
maintenance: 11 releases since May 2025, last commit March 2026.
External contributors have landed PRs from Google (`kaycebasques`) and
NVIDIA (`jacobtomlinson`). 30+ Python OSS projects use it including
`scrapy/scrapy`, `apache/hamilton`, `plone/documentation`,
`pola-rs/polars-cloud-client`, `NVIDIA-NeMo/Evaluator`,
`wagtail/sphinx-wagtail-theme`, `requests-cache/requests-cache`,
`pyrogram`.

The heavier sibling
[`NVIDIA/sphinx-llm`](https://github.com/NVIDIA/sphinx-llm) (Apache 2.0)
also emits per-page markdown twins. The two extensions are designed to
be complementary; we can adopt `sphinx-llm` later as a follow-up if
per-page twins become worthwhile.

## Context

Tracked under `DOC-875` in the anyscale/docs Jira (private). Part of a
broader rebuild-free legacy-version fix sweep (`DOC-849`). Lives
alongside the recent sphinx-sitemap fix in ray-project#63115.

---------

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

Labels

core Issues that should be addressed in Ray Core docs An issue or change related to documentation go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants