semvec/pypi-packages huggingface dataset:
sphinxcontrib-playground 0.1.4
A Sphinx extension for embedding interactive demo     using The Python Playground
License: MIT
Requires Python: >=3.6
Keywords: python,sphinx,playground,documentation

# sphinxcontrib-playground [![ci](https://github.com/ydcjeff/sphinxcontrib-playground/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/ydcjeff/sphinxcontrib-playground/actions/workflows/ci.yaml)

> A Sphinx extension to embed interactive demo examples with <a href="https://python-playground.netlify.app" target="_blank" rel="noopener noreferrer">The Python Playground</a>.

## Quickstart

Install with `pip`:

```sh
pip install sphinxcontrib-playground
```

Include below options in `conf.py`:

```py
playground_options = {
    'commit_sha': subprocess.check_output(['git', 'rev-parse', 'HEAD'], encoding='utf-8').strip(),
    'github_repo': 'github repo in string'  # e.g. ydcjeff/sphinxcontrib-playground
    'url': 'https://python-playground.netlify.app'  # playground url (you should have your own playground forked from The Python Playground)
}
```

Use with `.. playground::` directive:

```txt
.. playground:: path/to/the/python/file.py
      :title: Playground (Mandatory title - helpful for screen readers)
```

## Directive options

`.. playground::` directive options:

- `title`: Mandatory title for the embedding playground (helpful for screen readers)
- `height`: Height of the embedding playground (default: 500)
- `width`: Width of the embedding playground (default: 100%)

Souce code of this extension (Demo): https://ydcjeff.github.io/sphinxcontrib-playground/

## License

[MIT](./LICENSE)