# sphinx-copybutton
[![PyPI](https://img.shields.io/pypi/v/sphinx-copybutton.svg)](https://pypi.org/project/sphinx_copybutton/) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/sphinx-copybutton.svg)](https://anaconda.org/conda-forge/sphinx-copybutton) | [![Documentation](https://readthedocs.org/projects/sphinx-copybutton/badge/?version=latest)](https://sphinx-copybutton.readthedocs.io/en/latest/?badge=latest)
A small sphinx extension to add a "copy" button to code blocks.
See [the sphinx-copybutton documentation](https://sphinx-copybutton.readthedocs.io/en/latest/) for more details!
![Copy Button Demo](https://user-images.githubusercontent.com/1839645/150200219-73663c59-08fd-4185-b157-62f3769c02ac.gif)
## Installation
You can install `sphinx-copybutton` with `pip`:
```bash
pip install sphinx-copybutton
```
Or with `conda` via `conda-forge`:
```bash
conda install -c conda-forge sphinx-copybutton
```
## Usage
In your `conf.py` configuration file, add `sphinx_copybutton` to your extensions list.
E.g.:
```python
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](sphinx_copybutton/_static/copybutton.css))
## Development
Development should principally adhere to the [EBP Developer Conventions](https://github.com/executablebooks/.github/blob/master/CONTRIBUTING.md)
Sphinx-Copybutton is [hosted on the pypi repository](https://pypi.org/project/sphinx-copybutton/).
After a release - following the [EBP release instructions](https://github.com/executablebooks/.github/blob/master/CONTRIBUTING.md#releases-and-change-logs) - confirm that the new version of Sphinx-Copybutton [is posted to pypi](https://pypi.org/project/sphinx-copybutton/).
## Acknowledgements
Many thanks to the excellent [clipboard.js library](https://clipboardjs.com/) for the lightweight javascript code that powers the copy button!
Raw data
{
"_id": null,
"home_page": "https://github.com/executablebooks/sphinx-copybutton",
"name": "sphinx-copybutton",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "",
"author": "Executable Book Project",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/fc/2b/a964715e7f5295f77509e59309959f4125122d648f86b4fe7d70ca1d882c/sphinx-copybutton-0.5.2.tar.gz",
"platform": null,
"description": "# sphinx-copybutton\n\n[![PyPI](https://img.shields.io/pypi/v/sphinx-copybutton.svg)](https://pypi.org/project/sphinx_copybutton/) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/sphinx-copybutton.svg)](https://anaconda.org/conda-forge/sphinx-copybutton) | [![Documentation](https://readthedocs.org/projects/sphinx-copybutton/badge/?version=latest)](https://sphinx-copybutton.readthedocs.io/en/latest/?badge=latest)\n\nA small sphinx extension to add a \"copy\" button to code blocks.\n\nSee [the sphinx-copybutton documentation](https://sphinx-copybutton.readthedocs.io/en/latest/) for more details!\n\n![Copy Button Demo](https://user-images.githubusercontent.com/1839645/150200219-73663c59-08fd-4185-b157-62f3769c02ac.gif)\n\n## Installation\n\nYou can install `sphinx-copybutton` with `pip`:\n\n```bash\npip install sphinx-copybutton\n```\n\nOr with `conda` via `conda-forge`:\n\n```bash\nconda install -c conda-forge sphinx-copybutton\n```\n\n\n## Usage\n\nIn your `conf.py` configuration file, add `sphinx_copybutton` to your extensions list.\nE.g.:\n\n```python\nextensions = [\n ...\n 'sphinx_copybutton'\n ...\n]\n```\n\nWhen you build your site, your code blocks should now have little copy buttons to their\nright. Clicking the button will copy the code inside!\n\n## Customization\n\nIf you'd like to customize the look of the copy buttons, you can over-write any of the\nCSS rules specified in the Sphinx-CopyButton CSS file ([link](sphinx_copybutton/_static/copybutton.css))\n\n## Development\n\nDevelopment should principally adhere to the [EBP Developer Conventions](https://github.com/executablebooks/.github/blob/master/CONTRIBUTING.md)\n\nSphinx-Copybutton is [hosted on the pypi repository](https://pypi.org/project/sphinx-copybutton/).\nAfter a release - following the [EBP release instructions](https://github.com/executablebooks/.github/blob/master/CONTRIBUTING.md#releases-and-change-logs) - confirm that the new version of Sphinx-Copybutton [is posted to pypi](https://pypi.org/project/sphinx-copybutton/).\n\n## Acknowledgements\n\nMany thanks to the excellent [clipboard.js library](https://clipboardjs.com/) for the lightweight javascript code that powers the copy button!\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Add a copy button to each of your code cells.",
"version": "0.5.2",
"project_urls": {
"Homepage": "https://github.com/executablebooks/sphinx-copybutton"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9e481ea60e74949eecb12cdd6ac43987f9fd331156388dcc2319b45e2ebb81bf",
"md5": "6781b8e0c3f77c146776b07ab345402a",
"sha256": "fb543fd386d917746c9a2c50360c7905b605726b9355cd26e9974857afeae06e"
},
"downloads": -1,
"filename": "sphinx_copybutton-0.5.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6781b8e0c3f77c146776b07ab345402a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 13343,
"upload_time": "2023-04-14T08:10:20",
"upload_time_iso_8601": "2023-04-14T08:10:20.844249Z",
"url": "https://files.pythonhosted.org/packages/9e/48/1ea60e74949eecb12cdd6ac43987f9fd331156388dcc2319b45e2ebb81bf/sphinx_copybutton-0.5.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fc2ba964715e7f5295f77509e59309959f4125122d648f86b4fe7d70ca1d882c",
"md5": "dea6f565084ba8046512b18312fb5471",
"sha256": "4cf17c82fb9646d1bc9ca92ac280813a3b605d8c421225fd9913154103ee1fbd"
},
"downloads": -1,
"filename": "sphinx-copybutton-0.5.2.tar.gz",
"has_sig": false,
"md5_digest": "dea6f565084ba8046512b18312fb5471",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 23039,
"upload_time": "2023-04-14T08:10:22",
"upload_time_iso_8601": "2023-04-14T08:10:22.998763Z",
"url": "https://files.pythonhosted.org/packages/fc/2b/a964715e7f5295f77509e59309959f4125122d648f86b4fe7d70ca1d882c/sphinx-copybutton-0.5.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-14 08:10:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "executablebooks",
"github_project": "sphinx-copybutton",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "sphinx-copybutton"
}