Repository navigation
[doc] Remove the Jupyter notebook authoring template - #67426
Conversation
There was a problem hiding this comment.
Code Review
This pull request removes the Jupyter notebook template (template.ipynb) and updates the documentation to recommend writing examples directly as MyST Markdown (.md) files. It also updates the Buildkite test rules to reflect these changes. The review feedback suggests clarifying how to convert MyST Markdown files to Python scripts for testing, since the guide now emphasizes starting with .md files.
| ``` | ||
|
|
||
| In the same way, you can convert `.ipynb` notebooks to `.md` notebooks with `--to myst`. And if you want to convert your notebook to a Python file, for example, to test whether your whole script runs without errors, you can use `--to py` instead. | ||
| To convert your notebook to a Python file instead, for example, to test whether your whole script runs without errors, use `--to py`. |
There was a problem hiding this comment.
Since the updated guide recommends writing examples directly as MyST Markdown (.md) files, contributors will primarily have a .md file rather than a .ipynb file. To make it clear how to convert their MyST Markdown file to a Python script for testing, we should explicitly mention the .md file and provide the exact command.
| To convert your notebook to a Python file instead, for example, to test whether your whole script runs without errors, use `--to py`. | |
| To convert your MyST Markdown file to a Python file instead, for example, to test whether your whole script runs without errors, use the --to py option with your-example.md. |
There was a problem hiding this comment.
Not applying. This comment is on the jupytext --to py instructions, which this PR removes. The new end-to-end guide is a plain Markdown page that CI doesn't run, so converting it to a script isn't part of the workflow.
dstrodtman
left a comment
There was a problem hiding this comment.
Technical pass against the tree at this head. The CI routing change, the template exclusion, the cross-reference labels, and the moved cell-tag guidance all check out. The nb2py.py helpers ignore tags, so the remove-cell override works as described. Two things to fix before merge: doctest-style examples are missing from the "tested forms" wording, and the examples.yml route needs orphan: true. The rest are small.
| Tag every fenced code block with a language: `python`, `bash`, `yaml`, `json`, `text`, or `dockerfile`. Don't prefix shell commands with `$` or `#`, so readers can copy and paste them. | ||
|
|
||
| Every runnable snippet in the docs is tested. Write examples that run out of the box, and use `literalinclude` or a testable code cell rather than pasting untested code. See {ref}`How to write code snippets <writing-code-snippets_ref>`. | ||
| Write examples that run out of the box. Ray CI tests code in two forms: a `testcode` block, which CI runs when the page has a doctest target in `doc/BUILD.bazel`, and a script under the library's `doc_code/` directory that you include with `literalinclude`. Use either one only for code that runs as written and that CI should test. CI doesn't run a plain fenced code block, so use one for code you've run yourself but CI can't, and don't present it as tested. See {ref}`How to write code snippets <writing-code-snippets_ref>`. |
There was a problem hiding this comment.
This leaves out doctest-style examples. writing-code-snippets.md lists three tested types: doctest-style (>>>), code-output-style (testcode), and literalinclude. doc/test_prose_doctest_targets.py also treats a >>> prompt as a runnable example that needs a doctest target. Because of that, the description's "matches writing-code-snippets.md" isn't quite right, and a reader who puts >>> lines in what they think is a plain fence will trip the lint check.
Something like:
| Write examples that run out of the box. Ray CI tests code in two forms: a `testcode` block, which CI runs when the page has a doctest target in `doc/BUILD.bazel`, and a script under the library's `doc_code/` directory that you include with `literalinclude`. Use either one only for code that runs as written and that CI should test. CI doesn't run a plain fenced code block, so use one for code you've run yourself but CI can't, and don't present it as tested. See {ref}`How to write code snippets <writing-code-snippets_ref>`. | |
| Write examples that run out of the box. Ray CI tests code in three forms: a doctest-style `>>>` example or a `testcode` block, which CI runs when the page has a doctest target in `doc/BUILD.bazel`, and a script under the library's `doc_code/` directory that you include with `literalinclude`. Use these only for code that runs as written and that CI should test. CI doesn't run a plain fenced code block, so use one for code you've run yourself but CI can't, and don't present it as tested. See {ref}`How to write code snippets <writing-code-snippets_ref>`. |
There was a problem hiding this comment.
Withdrawn: this is superseded by #67429, which reserves >>> doctest-style examples for docstrings and adds that line to this paragraph. "Two forms" is correct for pages, so please don't apply the suggestion above.
| ## Adding code to an `.rST` or `.md` file | ||
|
|
||
| Modifying text in an existing documentation file is easy, but you need to be careful when it comes to adding code. The reason is that we want to ensure every code snippet in our documentation is tested. This requires us to have a process for including and testing code snippets in documents. To learn how to write testable code snippets, read [How to write code snippets](writing-code-snippets). | ||
| Modifying text in an existing documentation file is easy, but adding code takes more care. To show code that Ray CI tests, use a `testcode` block or include a script that CI runs. Use these only for code that runs as written. To learn how to write tested code snippets, read [How to write code snippets](writing-code-snippets.md). |
There was a problem hiding this comment.
Same gap as in writing-style.md: this leaves out doctest-style >>> examples, which writing-code-snippets.md also lists as tested.
| Modifying text in an existing documentation file is easy, but adding code takes more care. To show code that Ray CI tests, use a `testcode` block or include a script that CI runs. Use these only for code that runs as written. To learn how to write tested code snippets, read [How to write code snippets](writing-code-snippets.md). | |
| Modifying text in an existing documentation file is easy, but adding code takes more care. To show code that Ray CI tests, use a doctest-style `>>>` example, a `testcode` block, or include a script that CI runs. Use these only for code that runs as written. To learn how to write tested code snippets, read [How to write code snippets](writing-code-snippets.md). |
There was a problem hiding this comment.
Withdrawn: this is superseded by #67429. Pages use testcode or literalinclude and >>> stays in docstrings, so this sentence already matches where the stack is going. Please don't apply the suggestion above.
| @@ -213,7 +213,7 @@ def trainable(config): # Pass a "config" dictionary into your trainable. | |||
|
|
|||
| This code is imported by `literalinclude` from a file called `doc_code/key_concepts.py`. Every Python file in the `doc_code` directory is automatically tested by our CI system, but make sure to run scripts that you change (or new scripts) locally first. You don't need to run the testing framework locally. | |||
There was a problem hiding this comment.
Not part of this PR's change, but it's the same overclaim the PR removes two paragraphs up. Not every file in doc_code is tested. doc/BUILD.bazel excludes some, such as train/doc_code/hvd_trainer.py, train/doc_code/asynchronous_validation.py (pseudocode), core/doc_code/cross_language.py, and ray-observability/doc_code/ray-distributed-debugger.py. Optional, but cheap to fix while you're here:
| This code is imported by `literalinclude` from a file called `doc_code/key_concepts.py`. Every Python file in the `doc_code` directory is automatically tested by our CI system, but make sure to run scripts that you change (or new scripts) locally first. You don't need to run the testing framework locally. | |
| This code is imported by `literalinclude` from a file called `doc_code/key_concepts.py`. CI runs the Python files in a library's `doc_code` directory unless `doc/BUILD.bazel` excludes them, but make sure to run scripts that you change (or new scripts) locally first. You don't need to run the testing framework locally. |
There was a problem hiding this comment.
Applied in d83c411, with different wording. The suggestion above still overclaims, because some doc_code directories, such as cluster/doc_code, have no target in doc/BUILD.bazel at all. The sentence now says CI runs the doc_code scripts that the targets in doc/BUILD.bazel select, and asks authors to check that a target covers their script.
| An _end-to-end guide_ walks the reader through a complete task, from installing dependencies to a working result. Write it as a MyST Markdown page, like any other page in the Ray documentation. | ||
|
|
||
| To add a new executable example to the Ray documentation, you can start from our [MyST notebook template](https://github.com/ray-project/ray/blob/master/doc/source/_templates/template.md) or [Jupyter notebook template](https://github.com/ray-project/ray/blob/master/doc/source/_templates/template.ipynb). You could also download the document you're reading right now and start modifying it. Click the download button at the top of this page to get the `.ipynb` file. All the example notebooks in Ray Tune are automatically tested by our CI system, provided you place them in the [`examples` folder](https://github.com/ray-project/ray/tree/master/doc/source/tune/examples). If you have questions about how to test your notebook when contributing to other Ray sub-projects, ask in [the Ray community Slack](https://www.ray.io/join-slack) or directly on GitHub when opening your pull request. | ||
| To start, copy the [end-to-end guide template](https://github.com/ray-project/ray/blob/master/doc/source/_templates/template.md) into the directory of the library your guide covers. The template shows the page structure and the syntax Ray uses for admonitions, tabs, dropdowns, and cross-references. Then add the page to a toctree, or to the library's `examples.yml` gallery. |
There was a problem hiding this comment.
Two things about the examples.yml route:
- A page linked only from a gallery isn't in any toctree, so Sphinx warns that it isn't included in any toctree.
conf.pydoesn't suppress that warning, and RtD builds withfail_on_warning: true, so the build fails. Existing gallery pages setorphan: truein their front matter, astrain/examples/tf/tensorflow-mnist-example.mddoes. This PR keeps that advice only on the legacy page, so the new flow should mention it here, in the template, or in both. - Only Data, Serve, and Train have an
examples.yml, so "the library's" points Core, Tune, and RLlib authors at a file that doesn't exist.
| To start, copy the [end-to-end guide template](https://github.com/ray-project/ray/blob/master/doc/source/_templates/template.md) into the directory of the library your guide covers. The template shows the page structure and the syntax Ray uses for admonitions, tabs, dropdowns, and cross-references. Then add the page to a toctree, or to the library's `examples.yml` gallery. | |
| To start, copy the [end-to-end guide template](https://github.com/ray-project/ray/blob/master/doc/source/_templates/template.md) into the directory of the library your guide covers. The template shows the page structure and the syntax Ray uses for admonitions, tabs, dropdowns, and cross-references. Then add the page to a toctree. If the library has an `examples.yml` gallery, you can link the page from there instead, and add `orphan: true` to the page's front matter so the build doesn't warn that no toctree includes it. |
There was a problem hiding this comment.
Correction to point 1: the page doesn't need orphan: true. conf.py registers a source-read hook that sets orphan on every page an examples.yml gallery links to, through collect_example_orphans() in custom_directives.py. So a page listed only in a gallery doesn't trigger the toctree warning.
Point 2 stands. In d83c411, the section says to add the page to a toctree and offers the gallery only for Ray Data, Ray Serve, and Ray Train, with no orphan advice. #67639 also removes the stale orphan paragraph from the legacy page.
| Template for an end-to-end guide in the Ray documentation. | ||
|
|
||
| (document-tag-to-refer-to)= | ||
| Copy this file into the directory of the library your guide covers, rename it, and replace every <placeholder>. Then add the page to a toctree or an examples.yml gallery. Delete this comment before you open a pull request, but keep the maintainer comment under the title. |
There was a problem hiding this comment.
The same orphan: true gap as in docs.md. A gallery-only page fails the -W build without it. Maybe add: "If you link the page only from an examples.yml gallery, add orphan: true to the front matter."
There was a problem hiding this comment.
Withdrawn: same correction as on docs.md. conf.py marks gallery-linked pages as orphans, so the template doesn't need orphan: true. d83c411 only limits the gallery mention to Ray Data, Ray Serve, and Ray Train.
| ```shell | ||
| jupytext your-example.md --to ipynb | ||
| ```bash | ||
| jupyter nbconvert your-example.ipynb --to markdown |
There was a problem hiding this comment.
Minor: --to markdown puts cell outputs inline as indented blocks and writes images to a your-example_files/ directory. "Edit the result to match the template" covers this, but a sentence saying so would save someone a confused first run, for example: "Outputs come through as indented blocks, and images go to a your-example_files/ directory. Move any images you keep to images/."
Delete doc/source/_templates/template.ipynb and stop the contributor guide from directing authors to start from, download, or convert to an .ipynb. The jupytext subsection now covers converting an existing notebook to MyST Markdown or to a Python file. Drop the claim that CI tests every notebook placed in tune/examples/: that target globs *.ipynb, so it doesn't hold for the MyST Markdown file the section now asks for. Delete the _templates/ skip rule in test.rules.txt. It only kept template.ipynb off the doc/*.ipynb catch-all, and every remaining file under _templates/ routes the same without it. Replace its test case with one for _templates/layout.html. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Ronny Roland <[email protected]>
Rewrite doc/source/_templates/template.md as a plain MyST end-to-end guide that states Ray CI doesn't test it and records the Ray version the author ran it with. It uses only MyST, sphinx-design, and Sphinx roles, with no myst-nb notebook syntax. Move the contributor guidance off notebooks to match: - docs.md: replace "Creating a notebook example" with "Writing an end-to-end guide", and stop describing notebooks as the format for new examples. - writing-style.md: drop the claim that every snippet is tested. Tested code goes through literalinclude of a doc_code script; plain fenced blocks are untested. - publishing-examples-legacy.md: take over the cell-tag guidance, which only applies to the remaining in-tree notebooks. - publishing-examples.md: repoint the cross-reference. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
…ntainer-only Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
Only Data, Serve, and Train have an examples.yml gallery, and conf.py marks gallery-linked pages as orphans, so the page needs no front matter. Not every doc_code script has a test target. Also note what nbconvert does with outputs and images. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
4a0ac03 to
d83c411
Compare
## Description Stacked on #67426. #67639 is stacked on this PR. `writing-code-snippets.md` presents *doctest-style* (`>>>`) examples as an equal choice for docstrings and documentation pages. In practice, documentation pages don't use them. When this PR opened, 7 Markdown or rST pages under `doc/source/` had a `>>>` prompt, and only two of them ran it on purpose. #67432 has since converted those page examples to `testcode` and plain code blocks. On `master`, only `writing-code-snippets.md` and `getting-involved.md` have `>>>` prompts, and both teach the docstring format. This PR makes the guidance match: `>>>` doctest examples belong in docstrings, and documentation pages use `testcode` or `literalinclude`. ### What this PR changes - `doc/source/ray-contribute/writing-code-snippets.md`: - Front matter description and "Types of examples": *doctest-style* is for docstrings, and the other two types are for documentation pages. - The *doctest-style* example now uses the docstring `Example:` form instead of `.. doctest::`. The tip about dropping `.. doctest::` in docstrings becomes a note not to use *doctest-style* on documentation pages. - "Which type of example should you write?": where the example lives decides the style. The *doctest-style* and skip examples use the docstring form, and "When to use *code-output-style*" covers page examples that show output. - Leaves the GPU section alone, because #67204 rewrote it. - `doc/source/ray-contribute/writing-style.md`, "Code blocks": adds "Reserve `>>>` doctest-style examples for docstrings." This doesn't change `doc/BUILD.bazel`, `doc/test_prose_doctest_targets.py`, or any page with `>>>` examples. ## Related issues Stacked on #67426. Builds on #66974, which moved never-run `testcode` blocks to plain code blocks. ## Additional information ### Duplicate check I searched open PRs for `writing-code-snippets`, `doctest`, and `testcode`. #67204 also edits `writing-code-snippets.md` and `writing-style.md`, in other hunks. `git merge-tree` against it reports no conflicts. No open PR changes when to use *doctest-style*. ### Testing - The census: `git grep -c '^\s*>>> '` over `doc/source/*.md` and `*.rst` on `upstream/master`, then each page's enclosing blocks and its listing in `doc/BUILD.bazel` and `UNTESTED`. - `python doc/test_prose_doctest_targets.py` passes: "73 listed pages; every runnable page is accounted for." - `pre-commit run --files` on the changed files passes. - `vale` on `writing-code-snippets.md`: no new alerts except spelling flags on *literalinclude*, which the page already uses throughout. - The Read the Docs preview covers rendering. 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]>
#67426 deleted doc/source/_templates/template.ipynb, so the doc asset check now rejects its allowlist entry as stale. Signed-off-by: Douglas Strodtman <[email protected]>
#67639) ## Description Stacked on #67429, which is stacked on #67426. #67426 tells contributors not to add new notebooks, but other contributor docs still offer the in-tree notebook flow as a way to publish a new example. This PR removes those instructions and keeps only what someone needs to maintain the two notebook examples that remain. ### What this PR changes - `doc/source/ray-contribute/publishing-examples-legacy.md`: rewrites the page as "Maintaining an in-tree notebook example." It keeps its file name and its `publishing-examples-legacy` label, so no redirect is needed. - It names the two examples that still use the flow, `serve/tutorials/video-analysis` and `train/examples/transformers/transformer-reinforcement-learning`. These are the only `working_dir: //doc/...` entries in `release/release_tests.yaml`. - It drops the steps for publishing a new notebook: setting up a working directory, the `content/` layout, and wiring a toctree or `examples.yml`. Neither remaining example uses the `content/` layout. Each one has `README.ipynb`, a `README.md` copy, and `ci/`, and `exclude_patterns` in `conf.py` decides which file renders. - It drops the `orphan: true` advice. `conf.py` sets `orphan` on every page an `examples.yml` gallery links to through `collect_example_orphans()`. - It keeps the cell-tag guidance from #67426, the CI test, the release test, triggering it, and the pre-merge checks, all reworded for an existing example. The `tests.sh` sample matches what both examples run. The trigger example uses the real test name `video_analysis_pipeline`. - `doc/source/ray-contribute/publishing-examples.md`: replaces "Two ways to publish an example" with a description of the template-collections flow. It says not to publish a new example as an in-tree notebook and links the maintenance page. - `doc/README.md`: replaces "Adding examples as MyST Markdown Notebooks" with "Running in-tree notebooks." It says not to add new notebooks, points to `docs.md`, and keeps the `RUN_NOTEBOOKS` instructions, which `conf.py` still reads as `nb_execution_mode`. It drops the paragraph that recommended notebooks for examples and a commented-out link to a tutorial that no longer exists. - `doc/source/ray-contribute/writing-code-snippets.md`: "When to use *literalinclude*" said to use it for "an end-to-end example," which conflicts with #67426's end-to-end guide, which CI doesn't test. It now says "a longer example" and links `writing-e2e-guide`. - `doc/source/core/objects/object-spilling.md`: turns a `{doctest}` block into a plain `python` block. The block has no `>>>` prompt and no target, so it ran nothing, and it was the last `{doctest}` block on a documentation page. #67432 missed it because it searched for `>>>`. ## Related issues Stacked on #67429 and #67426. Follows #67432, which converted the other page doctests. ## Additional information ### Duplicate check I searched open PRs for `publishing-examples-legacy`, `in-tree notebook`, `RUN_NOTEBOOKS`, `object-spilling`, `writing-code-snippets`, and changes to `doc/README.md`. No open PR rewrites the legacy page or the README section. #66851 also edits `object-spilling.md`, and #65868 also edits `writing-code-snippets.md`, in other hunks. `git merge-tree` reports no conflicts with either. ### Testing - `pre-commit run --files` on the changed files passes, including the check that links to files on master resolve. - `python doc/test_prose_doctest_targets.py` passes: "73 listed pages; every runnable page is accounted for." - `rayci test-rules` at v0.51.0, the version `.rayciversion` pins, passes. - `vale` on the rewritten pages: no new alerts beyond a passive-voice flag on an unchanged sentence. The alerts in `doc/README.md` are all on lines this PR doesn't change. - The Read the Docs preview covers rendering. 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]>
Description
This PR retires the notebook authoring templates and the contributor guidance that points new examples at notebooks.
doc/source/_templates/template.ipynbis a Jupyter starter for new doc examples. It isn't a page, becausetemplates_pathkeeps_templates/out of the source files Sphinx reads. Nothing includes it, and no bazel target runs it. Its MyST sibling,template.md, is out of date. It importsray.rllib.agents.ppo, demos{eval-rst}and{margin}, and teaches{code-cell}notebooks that no build or test target executes. The "Creating a notebook example" section of the contributor guide links both templates, tells contributors to download the page as an.ipynb, and recommends converting their draft to.ipynbwhen they finish.This PR deletes the Jupyter template and turns
template.mdinto a template for an end-to-end guide written as an ordinary MyST page. The contributor guidance now says that a guide like this is a Markdown page its author ran, not a tested asset, and sends examples that need testing to the template-collections flow. The template and guidance changes come from #67428, which merged into this branch.What this PR changes
doc/source/_templates/template.ipynb.doc/source/_templates/template.md: rewrites it as an end-to-end guide skeleton. It uses only MyST, sphinx-design (tab-set,dropdown), colon-fence admonitions, and{ref}and{py:func}roles, with no myst-nb notebook syntax. A maintainer-only HTML comment under the title records that Ray CI doesn't test the guide and which Ray version its author last ran it with. The example code is a minimal Ray Core task. Sphinx still excludes the file through_templates/.doc/source/ray-contribute/docs.md:creating-notebook-example) with "Writing an end-to-end guide" (writing-e2e-guide). The new section points to the template and says Ray CI doesn't run the guide's code, so the author runs every step and records the Ray version. It sends tested examples to the template-collections flow and says not to add notebooks or notebook front matter. To convert an existing notebook, it givesjupyter nbconvert --to markdown..ipynb, the Tune Hyperopt notebook as a model, the kernel specification front matter,code-cellexamples, cell tags, reference labels, removed-cell testing, and thejupytextconversions. It also drops the claim that CI tests every notebook placed in the Tuneexamplesfolder..rSTor.mdfile": drops the claim that every snippet is tested and the.. code-cell:: pythonrecommendation. Tested code usestestcodeor aliteralincludescript, and code that CI can't run goes in a plain fenced block..mdfile name.examples.ymlgallery only for Ray Data, Ray Serve, and Ray Train, the only libraries that have one.conf.pymarks gallery-linked pages as orphans, so the page needs noorphanfront matter. It also says whatnbconvertdoes with outputs and images.doc_codedirectory is automatically tested." Some files and directories have no target indoc/BUILD.bazel, so it now tells contributors to check that a target covers their script.doc/source/ray-contribute/writing-style.md, "Code blocks": replaces "Every runnable snippet in the docs is tested." It now names the two tested forms, atestcodeblock on a page with a doctest target indoc/BUILD.bazeland adoc_code/script included withliteralinclude. It limits both to code that runs as written and that CI should test, and says CI doesn't run a plain fenced block. Since [doc] Convert the remaining page doctests to testcode and plain code blocks #67432, no documentation page runs a>>>example, and [doc] Reserve doctest-style examples for docstrings #67429 updateswriting-code-snippets.mdto match.doc/source/ray-contribute/publishing-examples-legacy.md: takes over the cell-tag guidance (hide-*,remove-*, and overriding realistic values in a removed cell), rewritten for.ipynbcell metadata. It applies only to the remaining in-tree notebooks.doc/source/ray-contribute/publishing-examples.md: repoints its cross-reference towriting-e2e-guide. No reference to the old label remains..buildkite/test.rules.txt: deletes thedoc/source/_templates/skip rule. It existed to keeptemplate.ipynboff thedoc/*.ipynbcatch-all. Every remaining file under_templates/(.html,.rst,.md,.gitkeep) gets the same tags without it:.mdand.rstfiles hit the leading prose skip first, and the rest fall through to the broaddoc/skip..buildkite/test.rules.test.txt: replaces thetemplate.ipynbcase withdoc/source/_templates/layout.html:.Merge-order note for #67012
#67012 adds
doc/asset_allowlists/notebooks.txt, which listsdoc/source/_templates/template.ipynb, and its check fails on an entry whose file is gone. Neither PR depends on the other, and they merge without textual conflicts. Whichever merges second deletes that line. If this PR merges first,python doc/test_doc_assets.py --updateon #67012 removes it. With this branch, current master, and #67012 merged together, the check fails only on that line and passes once it's deleted.Related issues
Includes #67428, which merged into this branch. #67429 is stacked on this branch, and #67639 is stacked on #67429. #67639 limits the legacy notebook page to maintaining the two remaining notebook examples. Follows #67008, which rewrote the same comment blocks in
test.rules.txtandtest.rules.test.txt, and #66974, which moved never-runtestcodeblocks to plain code blocks.Additional information
Duplicate check
I searched open PRs for
template.ipynb,template.md,_templates,notebook template,end-to-end guide,creating-notebook-example,ray-contribute/docs.md,writing-style.md, andpublishing-examples, then compared the files each docs PR in the results changes with this PR's. No open PR removes either template or rewrites these sections. The open PRs that touch the same files edit other hunks:test.rules.txtandtest.rules.test.txt. Each merges with this branch without conflicts. [doc] Update contributor CI docs for the docstring examples step and per-page doctest targets #67204, which editeddocs.mdandwriting-style.md, has merged, and this branch is rebased on it.writing-style.mdabout 170 lines below this PR's hunk.Testing
On this branch's head, rebased on master on 2026-10-30:
rayci test-rules, using v0.51.0, the version.rayciversionpins, built fromray-project/rayci: 197/197 cases pass, and the check also passes with the branch merged with current master. Changing the newlayout.htmlcase to expectdocmakes it fail, so the case is live.doc/source/_templates/as a case that expects no tags.rayci test-rulespasses both with and without the deleted rule. The only file whose routing the rule changes istemplate.ipynb, which routes todoc_examplewithout it.pre-commit run --fileson the changed files passes, including the check that links to files on master resolve.valeon the changed pages:docs.mdgoes from 98 alerts to 71, and the other pages stay level or drop. The only new alerts are spelling flags on "toctree" and "doctest", terms these guides already use, and a passive-voice flag on an unchanged sentence indocs.md.jupyter nbconvert your-example.ipynb --to markdown, with nbconvert 7.17.2 on a copy of a Tune notebook, writes a Markdown file withpythoncode fences and no Jupyter front matter.writing-e2e-guidereferences indocs.mdandpublishing-examples.mdresolve to it, and the legacy page renders "Hide and remove cells".From #67428:
ray[default]2.59.0 on Python 3.11, prints[0, 1, 4, 9].myst_enable_extensionsfromconf.py. The tab set, dropdown, and tip render.This PR was prepared with AI assistance (Claude Code), including the commits from #67428. Each author reviewed every line they changed.
🤖 Generated with Claude Code