diff --git a/.gitignore b/.gitignore index d8cf321a..36a82bf8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,6 @@ dist/ build/ grill.egg-info/ docs/build/ +docs/source/_static/wheels/*.whl docs/Makefile docs/make.bat diff --git a/docs/source/_static/wheels/.gitkeep b/docs/source/_static/wheels/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/docs/source/conf.py b/docs/source/conf.py index 65aad7bf..dddf5e64 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -48,6 +48,7 @@ 'sphinx_inline_tabs', 'sphinx.ext.autosectionlabel', 'sphinxcontrib.doxylink', + 'sphinx_pyrepl_web', ] # Offset to play well with copybutton @@ -101,9 +102,9 @@ # built documents. # # The short X.Y version. -version = '0.18' +version = '0.19' # The full version, including alpha/beta/rc tags. -release = '0.18.0' +release = '0.19.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -146,6 +147,9 @@ 'custom.css', ] +pyrepl_doctest_blocks = "autodoc" +pyrepl_autodoc_packages = ":project:,grill-usd-core==26.8,grill-names>=2.6.0" + # -- Options for HTMLHelp output ------------------------------------------ # Output file base name for HTML help builder. diff --git a/docs/source/index.rst b/docs/source/index.rst index b59e22a7..3ed393a3 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -17,6 +17,7 @@ pipeline views end_to_end + playground api Indices and tables diff --git a/docs/source/playground.rst b/docs/source/playground.rst new file mode 100644 index 00000000..904a1103 --- /dev/null +++ b/docs/source/playground.rst @@ -0,0 +1,22 @@ +Playground +========== + +Try ``grill.cook`` and ``grill.names`` in your browser. Packages are loaded via Pyodide; USD comes from the experimental ``grill-usd-core`` WASM build. + +.. attention:: + + This REPL is experimental. Asset creation writes to a temporary in-browser filesystem that is lost on refresh. + +.. py-repl:: + :packages: :project:,grill-usd-core==26.8,grill-names>=2.6.0 + :repl-title: Grill Cook Playground + :no-banner: + + >>> from grill import cook, names + >>> import tempfile + >>> from pathlib import Path + >>> cook.Repository.set(Path(tempfile.mkdtemp())) + >>> stage = cook.fetch_stage(cook.UsdAsset.get_anonymous()) + >>> character = cook.define_taxon(stage, "Character") + >>> character + >>> cook.create_unit(character, "Hero01", label="Hero 01") diff --git a/setup.cfg b/setup.cfg index 38e4ba8b..0fcc4537 100644 --- a/setup.cfg +++ b/setup.cfg @@ -52,7 +52,8 @@ include = grill.* # python -m pip install -e . docs = - sphinx + sphinx>=9,<10 + sphinx-pyrepl-web @ git+https://github.com/chrizzFTD/sphinx-pyrepl-web.git@cursor/project-package-lists-370c myst-parser sphinx-toggleprompt sphinx-copybutton