Shibuya Shibuya Shibuya
  • Examples
    • Admonitions Bring the attention of readers
    • Code Blocks Display code with highlights
    • Autodoc API documentation automatically
    • Jupyter Notebook Rendering .ipynb files
  • Branding
  • Sponsor me
  • Discussion

Getting started

  • Installation
  • Configuration
    • Logos
    • CSS Variables
    • Colors
    • Navbar links
    • Layouts
    • Announcement
    • Social network
    • Fonts
    • Sidebar
    • Languages
    • Advertisement
    • Icons
    • Markdown
  • Writing Guide
    • Markups
    • Block quotes
    • Lists
    • Tables
    • Admonitions
    • Code blocks
    • Math
    • Images and videos
    • API reference
    • Meta tags

Extensions

  • sphinx-copybutton
  • sphinx-design
  • sphinx-tabs
  • sphinx-togglebutton
  • jupyter-sphinx
  • nbsphinx
  • numpydoc
  • sphinxcontrib-mermaid
  • sphinx-docsearch
  • sphinx-click
  • sphinx-sqlalchemy
  • sphinx-contributors
  • sphinx-autoapi
  • sphinx-iconify

Development

  • Contributing
    • Translations
    • Roadmap
  • Alternatives
  • Stability Policy
  • Changelog

On this page

  • Install
lepture/shibuya 0 0
Edit this page
  1. Shibuya /
  2. sphinx-copybutton

sphinx-copybutton¶

Add a little “copy” button to the right of your code blocks. This extension is maintained by Executable Books.

  • Documentation: https://sphinx-copybutton.readthedocs.io/

  • Source Code: https://github.com/executablebooks/sphinx-copybutton

Install¶

pip install sphinx-copybutton

Then, add the extension to your conf.py:

conf.py¶
extensions = [
    # ...
    "sphinx_copybutton",
]

Hint

Hovering on the code block above, you will see a copy button.

Previous
Meta tags
Next
sphinx-design

Copyright © 2023, Hsiaoming Yang

Made with Sphinx and Shibuya theme.