{"library":"sphinx-thebe","title":"Sphinx Thebe","type":"library","description":"Sphinx Thebe is a Sphinx extension that integrates interactive code blocks into documentation using Thebe.js and Binder. It allows readers to execute code examples directly in their browser against a live Jupyter kernel. The current version is 0.3.1, with releases occurring periodically to address Sphinx compatibility and feature enhancements.","language":"python","status":"active","last_verified":"Thu Apr 16","install":{"commands":["pip install sphinx-thebe"],"cli":null},"imports":["extensions = ['sphinx_thebe']"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/executablebooks/sphinx-thebe","docs":null,"changelog":null,"pypi":"https://pypi.org/project/sphinx-thebe/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"# 1. Install sphinx-thebe:\n# pip install sphinx-thebe\n\n# 2. In your Sphinx project's conf.py, add 'sphinx_thebe' to extensions:\n# extensions = [\n#     'sphinx_thebe'\n# ]\n\n# 3. Configure thebe_config (replace with your BinderHub URL and kernel):\n# thebe_config = {\n#     'repository_url': 'https://github.com/binder-examples/jupyter-stacks-datascience',\n#     'repository_branch': 'master',\n#     'binderhub_url': 'https://mybinder.org',\n#     'kernel_name': 'python3',\n#     'code_selector': 'div.highlight',\n#     'always_load': false\n# }\n\n# 4. In a reStructuredText file (.rst) or MyST Markdown file (.md) write:\n# .. thebe-button::\n#    :label: Run this code!\n\n# .. code-block:: python\n\n#    print('Hello, Thebe!')\n#    x = 1 + 1\n#    print(f'x is {x}')\n\n# 5. Build your Sphinx documentation:\n# make html\n","lang":"python","description":"To quickly get started, install the package, then add `sphinx_thebe` to your `conf.py` extensions list. Crucially, define a `thebe_config` dictionary specifying your BinderHub URL and kernel details. Finally, use the `thebe-button` directive followed by a code block in your reStructuredText or MyST Markdown files.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}