Skip to main content

Add a copy button to each of your code cells.

Project description

sphinx-copybutton

PyPI | Conda Version | Documentation

A small sphinx extension to add a "copy" button to code blocks.

See the sphinx-copybutton documentation for more details!

Installation

You can install sphinx-copybutton with pip:

pip install sphinx-copybutton

Or with conda via conda-forge:

conda install -c conda-forge sphinx-copybutton

Usage

In your conf.py configuration file, add sphinx_copybutton to your extensions list. E.g.:

extensions = [
    ...
    'sphinx_copybutton'
    ...
]

When you build your site, your code blocks should now have little copy buttons to their right. Clicking the button will copy the code inside!

Customization

If you'd like to customize the look of the copy buttons, you can over-write any of the CSS rules specified in the Sphinx-CopyButton CSS file (link)

Development

Development should principally adhere to the EBP Developer Conventions

Sphinx-Copybutton is hosted on the pypi repository. After a release - following the EBP release instructions - confirm that the new version of Sphinx-Copybutton is posted to pypi.

Project details


Download files

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

Source Distribution

sphinx-copybutton-0.3.1.tar.gz (112.6 kB view details)

Uploaded Source

Built Distribution

sphinx_copybutton-0.3.1-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file sphinx-copybutton-0.3.1.tar.gz.

File metadata

  • Download URL: sphinx-copybutton-0.3.1.tar.gz
  • Upload date:
  • Size: 112.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.9

File hashes

Hashes for sphinx-copybutton-0.3.1.tar.gz
Algorithm Hash digest
SHA256 0e0461df394515284e3907e3f418a0c60ef6ab6c9a27a800c8552772d0a402a2
MD5 52b3a51953ac19fef56e15f2a6be1b90
BLAKE2b-256 9b5d1f09cae70eb51ff15a60b0e6f1cea9215abacdccdafb35e0406bf6088431

See more details on using hashes here.

File details

Details for the file sphinx_copybutton-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: sphinx_copybutton-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.9

File hashes

Hashes for sphinx_copybutton-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5125c718e763596e6e52d92e15ee0d6f4800ad3817939be6dee51218870b3e3d
MD5 ce3408347623e14fd23092a80b4235b5
BLAKE2b-256 071b691407165e9104569d10ed568438003a32168772c47eacc3a473caa7dddd

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