Skip to content

Commit

Permalink
DOCS : Use the sphinx-copybutton extension in documentation (#503)
Browse files Browse the repository at this point in the history
modified:   docs/source/conf.py
	modified:   setup.py
  • Loading branch information
Poruri Sai Rahul committed Jun 14, 2022
1 parent 434ae6c commit 38b71f9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx_copybutton",
"traits.util.trait_documenter",
]

Expand Down Expand Up @@ -114,6 +115,13 @@
("py:class", "wx."),
]

# Options for Sphinx copybutton extension
# ---------------------------------------

# Matches prompts - "$ ", ">>>" and "..."
copybutton_prompt_text = r">>> |\.\.\. |\$ "
copybutton_prompt_is_regexp = True

# -- Options for Napoleon extension ---------------------------------------

# Do pre-process NumPyDoc - style type strings. This prevents warnings
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def get_long_description():
# Jinja2 is pinned for compatibility with the Sphinx pin.
# xref: sphinx-doc/sphinx#10291
"Jinja2<3.1",
"sphinx-copybutton",
],
},
packages=find_packages(exclude=["ci"]),
Expand Down

0 comments on commit 38b71f9

Please sign in to comment.