Skip to content

Commit

Permalink
Add copy button to all source codes
Browse files Browse the repository at this point in the history
  • Loading branch information
ffl096 committed Oct 16, 2024
1 parent 78a02c6 commit 3d5d57b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"sphinx.ext.intersphinx",
"sphinx.ext.mathjax",
"sphinx.ext.viewcode",
"sphinx_copybutton",
"sphinx_gallery.load_style",
]

Expand Down Expand Up @@ -121,3 +122,8 @@
numpydoc_validation_checks = {"all", "GL01", "ES01", "SA01", "EX01"}
numpydoc_show_class_members = False
numpydoc_class_members_toctree = False

# Exclude copy button from appearing over notebook cell numbers by using :not()
# The default copybutton selector is `div.highlight pre`
# https://github.com/executablebooks/sphinx-copybutton/blob/master/sphinx_copybutton/__init__.py#L82
copybutton_selector = ":not(.prompt) > div.highlight pre"
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ doc = [
"nbsphinx_link",
"numpydoc >= 1.8.0",
"sphinx",
"sphinx-copybutton",
"sphinx_gallery",
"pydata-sphinx-theme"
]
Expand Down

0 comments on commit 3d5d57b

Please sign in to comment.