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.2.tar.gz (114.4 kB view details)

Uploaded Source

Built Distribution

sphinx_copybutton-0.3.2-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sphinx-copybutton-0.3.2.tar.gz
  • Upload date:
  • Size: 114.4 kB
  • Tags: Source
  • 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.0 CPython/3.9.5

File hashes

Hashes for sphinx-copybutton-0.3.2.tar.gz
Algorithm Hash digest
SHA256 f901f17e7dadc063bcfca592c5160f9113ec17501a59e046af3edb82b7527656
MD5 3dbcf790bd26726af173d65644bb299d
BLAKE2b-256 06b7fbb496189274cbf1a4c65ee56dfa35e273621d32d2e95c0cc05107df7047

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sphinx_copybutton-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 12.1 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.0 CPython/3.9.5

File hashes

Hashes for sphinx_copybutton-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f16f8ed8dfc60f2b34a58cb69bfa04722e24be2f6d7e04db5554c32cde4df815
MD5 a5b2111abc341518ca8cf639c7e3bf59
BLAKE2b-256 7c78f56420fd848699e0ae09714c5802697715545d582270b6c9b64d243089ff

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