Skip to content

Commit 43ca475

Browse files
aclark4lifetimgraham
authored andcommitted
Add copy button to documentation code blocks
1 parent b9a89ed commit 43ca475

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

docs/conf.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
extensions = [
3535
"djangodocs",
3636
"sphinx.ext.intersphinx",
37+
"sphinx_copybutton",
3738
]
3839

3940
# templates_path = ["_templates"]
@@ -57,3 +58,9 @@
5758

5859
html_theme = "furo"
5960
html_static_path = ["_static"]
61+
62+
# -- Options for copy button -------------------------------------------------
63+
# https://sphinx-copybutton.readthedocs.io/en/latest/use.html#use-and-customize
64+
65+
copybutton_prompt_text = r">>> |\.\.\. |\$ "
66+
copybutton_prompt_is_regexp = True

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ classifiers = [
3737
docs = [
3838
"sphinx>=7",
3939
"furo>=2025.7.19",
40+
"sphinx-copybutton",
4041
]
4142

4243
[project.urls]

0 commit comments

Comments
 (0)