diff --git a/.gitignore b/.gitignore index 089d925d..4f8e2fb6 100644 --- a/.gitignore +++ b/.gitignore @@ -23,5 +23,5 @@ rust/target **/.coverage.* **/coverage **/dist/* -docs/_static/test-*.html +docs/_static/test-js.html javascript/src/lib/fallbacks diff --git a/docs/Makefile b/docs/Makefile index 4b4984e7..2e81f505 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -57,11 +57,8 @@ _static/test-js.html: cp ../javascript/dist/bundle-js.js _static/dist/bundle-js.js cp ../javascript/index.html _static/test-js.html -_static/test-py.html: +_static/dist/pyodide.js: cd ../python && $(MAKE) webpack $(MFLAGS) - mkdir -p _static/dist - cp ../javascript/dist/bundle-py.js _static/dist/bundle-py.js - cat ../javascript/index.html | sed s#_static/bundle-js.js#_static/bundle-py.js > _static/test-py.html _static/test-rs.html: cd ../rust && $(MAKE) webpack $(MFLAGS) @@ -69,7 +66,7 @@ _static/test-rs.html: cp ../rust/dist/bundle-rs.js _static/dist/bundle-rs.js cat ../javascript/index.html | sed s#_static/bundle-js.js#_static/bundle-rs.js > _static/test-rs.html -html: _static/test-js.html +html: _static/test-js.html _static/dist/pyodide.js $(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) # Catch-all target: route all unknown targets to Sphinx using the new diff --git a/docs/_static/test-py.html b/docs/_static/test-py.html new file mode 100644 index 00000000..57db7cf3 --- /dev/null +++ b/docs/_static/test-py.html @@ -0,0 +1,55 @@ + + + + + + + +

+ You can execute any Python code. Just enter something in the box below and + click the button. +

+ + +
+
+
Output:
+ + + + + diff --git a/python/Makefile b/python/Makefile index b0203030..9366dc6e 100644 --- a/python/Makefile +++ b/python/Makefile @@ -66,3 +66,8 @@ endif clean: rm -r ./{*,*/*}{.pyc,__pycache__,.mypy_cache} || echo + +webpack: + mkdir -p ../docs/_static/dist + wget https://cdn.jsdelivr.net/pyodide/v0.26.2/full/pyodide.js -O ../docs/_static/dist/pyodide.js + tar --exclude=__pycache__ -czvf ../docs/_static/dist/python.tar.gz src