Skip to content

Add interactive Python REPL playground to docs#51

Draft
chrizzFTD wants to merge 2 commits into
developfrom
cursor/docs-playground-pyrepl-a03b
Draft

Add interactive Python REPL playground to docs#51
chrizzFTD wants to merge 2 commits into
developfrom
cursor/docs-playground-pyrepl-a03b

Conversation

@chrizzFTD

Copy link
Copy Markdown
Collaborator

Summary

Adds a Playground documentation page with an embedded Pyodide REPL via sphinx-pyrepl-web. The REPL preloads grill-usd-core (WASM pxr), grill-names, and grill, then replays the end-to-end cook workflow from the docs examples.

This replaces the Rerun web-viewer approach from draft PR #46 with an interactive Python session starting at from grill import cook, names.

Changes

  • Add sphinx-pyrepl-web>=0.2.0 and sphinx>=9,<10 to the [docs] extra in setup.cfg
  • Register sphinx_pyrepl_web in docs/source/conf.py
  • Add docs/source/playground.rst with a .. py-repl:: replay directive
  • Add playground to the toctree (after End to End Example)
  • Add REPL sizing rules to docs/source/_static/custom.css
  • Sync documented version to 0.19.1

Validation

  • Local Sphinx build succeeds (python3 docs/source/build_docs.py)
  • playground.html emits <py-repl> with pinned packages and replay-src
  • Replay script written to _static/pyrepl/playground-1.py
  • Vendored pyrepl.js included on playground page
  • Full browser replay (package load + cook workflow) — needs manual check on RTD preview due to ~12 MB WASM USD load

Notes

The REPL is marked experimental in the docs. Asset creation uses a temporary in-browser filesystem that is lost on refresh. First load may be slow while Pyodide installs packages.

Open in Web Open in Cursor 

cursoragent and others added 2 commits July 4, 2026 13:24
Integrate sphinx-pyrepl-web with a new Playground page that embeds
a Pyodide REPL preloading grill-usd-core, grill-names, and grill.
The replay session walks through the end-to-end cook workflow from
the documentation examples.

Also bump documented version to 0.19.1 and pin sphinx>=9 for the
new extension dependency.

Co-authored-by: chrizzftd <chrizzFTD@users.noreply.github.com>
Co-authored-by: chrizzftd <chrizzFTD@users.noreply.github.com>
@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.37%. Comparing base (bbc2b8b) to head (49e3acb).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop      #51   +/-   ##
========================================
  Coverage    89.37%   89.37%           
========================================
  Files           13       13           
  Lines         3088     3088           
========================================
  Hits          2760     2760           
  Misses         328      328           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants