--- id: sphinx-copybutton version: "0.5.2" license: MIT License license_treatment: permissive maintenance: active --- # sphinx-copybutton — Add a copy button to each of your code cells. License: permissive · Maintenance: active · Downloads: 7.8M/mo ## What it is and what it does sphinx-copybutton is a lightweight Sphinx extension that enhances code blocks in documentation by adding a clickable copy button. When readers click the button, the code block's content is copied to their clipboard. The extension integrates directly into Sphinx's build process and requires only a single line addition to your documentation configuration file. The package relies on the clipboard.js library for its JavaScript functionality and is designed to work with modern Python versions. It's widely used in documentation projects and has accumulated significant download volume, indicating stable, practical utility for documentation authors who want to improve the reader experience when sharing code examples. Use it for: - Add copy buttons to code examples in API documentation so users can quickly copy sample calls - Enhance tutorial documentation where readers need to copy and paste setup commands or code snippets - Improve user experience in technical guides by reducing friction when copying multi-line code blocks - Enable one-click code copying in Jupyter Book or MyST Markdown documentation built with Sphinx ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A Sphinx extension that adds a copy button to code blocks in documentation, allowing readers to quickly copy code snippets to their clipboard. Yes. This is a low-friction, actively maintained extension that solves a genuine user experience problem in documentation. With no security vulnerabilities, a permissive license, and a single dependency on Sphinx itself, it's a straightforward addition to any Sphinx-based documentation project. ## Install pip install sphinx-copybutton uv add sphinx-copybutton poetry add sphinx-copybutton ## Installing sphinx-copybutton Before you install: Low friction installation with a single runtime dependency on sphinx. The package is actively maintained with recent commits and has been stable since its early releases. License in practice: MIT License permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial documentation projects. Quickstart: pip install sphinx-copybutton # In conf.py: extensions = [ 'sphinx_copybutton' ] Verify before relying: - Whether the copy button appearance and behavior can be customized beyond CSS overrides - Browser compatibility and JavaScript runtime requirements for the clipboard functionality ## Package facts - License: MIT License (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 7.8M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags sphinx code block copy button, sphinx documentation copy code, sphinx extension code copying, add copy button to code blocks, sphinx code snippet clipboard, documentation code block ui, sphinx interactive code blocks, sphinx-extension, documentation-ui [View on SkillFed](https://skillfed.io/packages/sphinx-copybutton) · [View on PyPI](https://pypi.org/project/sphinx-copybutton/)