Skip to main content

A Sphinx extension for embedding interactive demo using The Python Playground

Project description

sphinxcontrib-playground ci

A Sphinx extension to embed interactive demo examples with The Python Playground.

Quickstart

Install with pip:

pip install sphinxcontrib-playground

Include below options in conf.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:

.. 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

sphinxcontrib_playground-0.1.4-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page