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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: sphinx-copybutton-0.3.3.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.1 CPython/3.9.5

File hashes

Hashes for sphinx-copybutton-0.3.3.tar.gz
Algorithm Hash digest
SHA256 3695987d5e98e3b223471aaed8aa7491e03e9bfc48ed655a91446fd5e30b6c25
MD5 94adfbaabb081a189f481871d9950587
BLAKE2b-256 3f57c6247f4bb0a192997af005b0cc27704f725aaf9908c9f26612fd88b5d206

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sphinx_copybutton-0.3.3-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.1 CPython/3.9.5

File hashes

Hashes for sphinx_copybutton-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 19850e9c1ed09c899f136ce3cfa304cb3b6d2f508528c19d8f512ccc8c66b0d4
MD5 3dfeaec97369142b1de09282ed0ef073
BLAKE2b-256 eb6d7bdc941b2dab8333ab617ed4eb1f0b3a09c3e9bc2c9ef961ae8f9c7139b0

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