Skip to main content

sphinx-copybutton

PyPI | 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

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.

Metadata

Release files for sphinx-copybutton 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinx-copybutton 0.3.0
File Size Uploaded
sphinx-copybutton-0.3.0.tar.gz 112.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinx-copybutton 0.3.0
File Interpreter ABI Platform
sphinx_copybutton-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 123.3 kB

Release files / sphinx-copybutton-0.3.0.tar.gz

Download URL sphinx-copybutton-0.3.0.tar.gz
Size 112.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4becad3a1e7c50211f1477e34fd4b6d027680e1612f497cb5b88cf85bccddaaa
BLAKE2b-256 checksum
How to use checksums
417890feb86c96ab6227530fd1c32f549a5eb5447c77f30842a5e2d61b917c3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.8

Release files / sphinx_copybutton-0.3.0-py3-none-any.whl

Download URL sphinx_copybutton-0.3.0-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4cd06afd0588aa43eba968bfc6105e1ec6546c50a51f880af1d89afaebc6fb58
BLAKE2b-256 checksum
How to use checksums
eaf982e0040dbe208b976441dfad6a6ba1de380aef50537ac5e0694d8812216c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.8
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page