Skip to content

Commit 43239f8

Browse files
authored
add sphinx_copybutton extension (#553)
* add sphinx_copybutton extension * add a comment to the release notes * add `sphinx_copybutton` to the pyproject.toml * pin sphinx_copybutton version * add suggestion to release notes
1 parent 67e3484 commit 43239f8

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

doc/conf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,12 @@
4242
"nbsphinx",
4343
"nbsphinx_link",
4444
"sphinx.ext.imgconverter", # for SVG conversion
45+
"sphinx_copybutton",
4546
]
4647

48+
copybutton_prompt_text = r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: "
49+
copybutton_prompt_is_regexp = True
50+
4751
# Add any paths that contain templates here, relative to this directory.
4852
templates_path = ["_templates"]
4953

doc/release_notes.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
Release Notes
22
=============
33

4-
.. Upcoming Version
4+
Upcoming Version
5+
----------------
6+
7+
* Add the `sphinx-copybutton` to the documentation
58

69
Version 0.6.1
710
--------------

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ docs = [
5252
"sphinx==7.3.7",
5353
"sphinx_rtd_theme==2.0.0",
5454
"sphinx_book_theme==1.1.3",
55+
"sphinx-copybutton==0.5.2",
5556
"nbsphinx==0.9.4",
5657
"nbsphinx-link==1.3.0",
5758
"docutils<0.21",

0 commit comments

Comments
 (0)