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 details)

Uploaded Python 3

File details

Details for the file sphinxcontrib_playground-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: sphinxcontrib_playground-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.10

File hashes

Hashes for sphinxcontrib_playground-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 193c0e828551ca5666c58e76236aec91c814fa410dc23f8dc14892550e0dc823
MD5 a93f03cacdf176fab53e2c0387788947
BLAKE2b-256 eb365b535d4a175d5904b422f338b5655de41e1c28db78c53fe9d353ddeab8d7

See more details on using hashes here.

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