Skip to content

Commit fc7c7c3

Browse files
authored
Add copy button for code in docs (#489)
1 parent 1456fab commit fc7c7c3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/source/conf.py

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
'sphinx.ext.mathjax',
2121
'sphinx.ext.napoleon',
2222
'sphinx.ext.viewcode',
23+
'sphinx_copybutton',
2324
'pyg',
2425
]
2526

@@ -45,6 +46,9 @@
4546
'xgboost': ('https://xgboost.readthedocs.io/en/stable/', None),
4647
}
4748

49+
copybutton_prompt_text = r">>> |\.\.\. "
50+
copybutton_prompt_is_regexp = True
51+
4852

4953
def setup(app):
5054
def rst_jinja_render(app, _, source):

0 commit comments

Comments
 (0)