Skip to content

Commit d944070

Browse files
author
Matthias Koeppe
committed
sagemath_doc_html: Use sphinx_copybutton
1 parent 511bdf2 commit d944070

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

build/pkgs/sagemath_doc_html/dependencies

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
sagelib sphinx pplpy_doc | $(SAGERUNTIME) maxima networkx scipy sympy matplotlib pillow mathjax mpmath ipykernel jupyter_client conway_polynomials tachyon jmol ipywidgets jupyter_sphinx sage_docbuild elliptic_curves furo fpylll
1+
sagelib sphinx sphinx_copybutton pplpy_doc | $(SAGERUNTIME) maxima networkx scipy sympy matplotlib pillow mathjax mpmath ipykernel jupyter_client conway_polynomials tachyon jmol ipywidgets jupyter_sphinx sage_docbuild elliptic_curves furo fpylll
22

33
# Building the documentation has many dependencies, because all
44
# documented modules are imported and because we use matplotlib to

src/sage_docbuild/conf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
'sphinx.ext.todo',
4747
'sphinx.ext.extlinks',
4848
'sphinx.ext.mathjax',
49+
'sphinx_copybutton',
4950
'IPython.sphinxext.ipython_directive',
5051
'matplotlib.sphinxext.plot_directive',
5152
'jupyter_sphinx',
@@ -255,6 +256,11 @@ def set_intersphinx_mappings(app, config):
255256
# By default document are not master.
256257
multidocs_is_master = True
257258

259+
# https://sphinx-copybutton.readthedocs.io/en/latest/use.html
260+
copybutton_prompt_text = r"sage: |[.][.][.][.]: |\$ "
261+
copybutton_prompt_is_regexp = True
262+
copybutton_exclude = '.linenos, .gp, .c' # exclude comments
263+
258264
# Options for HTML output
259265
# -----------------------
260266

0 commit comments

Comments
 (0)