GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - executablebooks/sphinx-copybutton: Add a "copy" button to code blocks in Sphinx

BranchesTags
Open more actions menu

Latest commit

 

History

234 Commits
234 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
clipboard.js @ 57345ab
clipboard.js @ 57345ab
 
 
docs
docs
 
 
sphinx_copybutton
sphinx_copybutton
 
 
.flake8
.flake8
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
MANIFEST.in
MANIFEST.in
 
 
README.md
README.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
readthedocs.yml
readthedocs.yml
 
 
setup.cfg
setup.cfg
 
 
setup.py
setup.py
 
 
tox.ini
tox.ini
 
 

Repository files navigation

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!

Copy Button Demo

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.

Acknowledgements

Many thanks to the excellent clipboard.js library for the lightweight javascript code that powers the copy button!

About

Add a "copy" button to code blocks in Sphinx

sphinx-copybutton.readthedocs.io/en/latest/

Topics

sphinx-extension

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing
Activity
Custom properties

Stars

270 stars

Watchers

10 watching

Forks

59 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.