From 3626458fa302e5e8ed9fff750403c23343c35b72 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 2 Jul 2024 21:44:22 -0700 Subject: [PATCH] Add sphinx-copybutton to allow copying code blocks with a single click of a button --- CHANGES.rst | 1 + docs/conf.py | 3 ++- requirements_docs.txt | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 7499c5d1..00342691 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -67,6 +67,7 @@ New features: - Add function ``icalendar.use_pytz()``. - Add `sphinx-autobuild` for `livehtml` Makefile target. - Add pull request preview on Read the Docs. +- Add sphinx-copybutton to allow copying code blocks with a single click of a button. Bug fixes: diff --git a/docs/conf.py b/docs/conf.py index a46c8829..d3a67d1c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,7 +20,8 @@ extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.coverage', - 'sphinx.ext.viewcode' + 'sphinx.ext.viewcode', + 'sphinx_copybutton' ] source_suffix = '.rst' master_doc = 'index' diff --git a/requirements_docs.txt b/requirements_docs.txt index 3691eef5..bffee2f0 100644 --- a/requirements_docs.txt +++ b/requirements_docs.txt @@ -1,4 +1,5 @@ Sphinx>=1.2.3 sphinx_rtd_theme sphinx-autobuild +sphinx-copybutton .