Sphinx PyScript#
This is a Sphinx extension that allows you to use PyScript in your documentation.
Installation#
Install with pip:
pip install sphinx-pyscript
Usage#
Add the extension to your conf.py
:
extensions = [
"sphinx_pyscript",
]
To load PyScript on a page, either use the py-config
directive to load the config in YAML format:
.. py-config::
splashscreen:
autoclose: true
packages:
- matplotlib
or with MyST, use the top-matter:
---
py-config:
splashscreen:
autoclose: true
packages:
- matplotlib
---
See the examples for more details.
Configuration#
The extension has the following configuration options:
- pyscript_js
The URL for the PyScript JavaScript file
- pyscript_css
The URL for the PyScript CSS file