Skip to content

Commit 758cd92

Browse files
authored
MAINT use sphinx-copybutton extension (#1005)
1 parent 2013939 commit 758cd92

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

build_tools/circle/build_doc.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ mamba create -n $CONDA_ENV_NAME --yes --quiet \
112112
"$(get_dep sphinx-gallery $SPHINX_GALLERY_VERSION)" \
113113
"$(get_dep numpydoc $NUMPYDOC_VERSION)" \
114114
"$(get_dep sphinxcontrib-bibtex $SPHINXCONTRIB_BIBTEX_VERSION)" \
115+
"$(get_dep sphinx-copybutton $SPHINXCONTRIB_BIBTEX_VERSION)" \
115116
"$(get_dep pydata-sphinx-theme $PYDATA_SPHINX_THEME_VERSION)" \
116117
memory_profiler packaging seaborn pytest coverage compilers tensorflow
117118

doc/conf.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,13 @@
4242
"numpydoc",
4343
"sphinx_issues",
4444
"sphinx_gallery.gen_gallery",
45+
"sphinx_copybutton",
4546
]
4647

48+
# Specify how to identify the prompt when copying code snippets
49+
copybutton_prompt_text = r">>> |\.\.\. "
50+
copybutton_prompt_is_regexp = True
51+
4752
# Add any paths that contain templates here, relative to this directory.
4853
templates_path = ["_templates"]
4954

@@ -329,5 +334,4 @@ def generate_min_dependency_substitutions(app):
329334
def setup(app):
330335
app.connect("builder-inited", generate_min_dependency_table)
331336
app.connect("builder-inited", generate_min_dependency_substitutions)
332-
app.add_js_file("js/copybutton.js")
333337
app.add_css_file("basic.css")

imblearn/_min_dependencies.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"mypy": ("1.3.0", "tests"),
3434
"sphinx": ("6.0.0", "docs"),
3535
"sphinx-gallery": ("0.13.0", "docs"),
36+
"sphinx-copybutton": ("0.5.2", "docs"),
3637
"numpydoc": ("1.5.0", "docs"),
3738
"sphinxcontrib-bibtex": ("2.4.1", "docs"),
3839
"pydata-sphinx-theme": ("0.13.3", "docs"),

0 commit comments

Comments
 (0)