Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/pkgs/sagemath_doc_html/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
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
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

# Building the documentation has many dependencies, because all
# documented modules are imported and because we use matplotlib to
Expand Down
18 changes: 18 additions & 0 deletions build/pkgs/sphinx_copybutton/SPKG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
sphinx_copybutton: Add a copy button to each of your code cells.
================================================================

Description
-----------

Add a copy button to each of your code cells.

License
-------

MIT License

Upstream Contact
----------------

https://pypi.org/project/sphinx-copybutton/

5 changes: 5 additions & 0 deletions build/pkgs/sphinx_copybutton/checksums.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
tarball=sphinx_copybutton-VERSION-py3-none-any.whl
sha1=329d24e382c80fbb39aba221479f3ca3f566d19c
md5=1181950a5fd59160f7ec588e805d986f
cksum=142562474
upstream_url=https://pypi.io/packages/py3/s/sphinx_copybutton/sphinx_copybutton-VERSION-py3-none-any.whl
4 changes: 4 additions & 0 deletions build/pkgs/sphinx_copybutton/dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$(PYTHON) sphinx | $(PYTHON_TOOLCHAIN)

----------
All lines of this file are ignored except the first.
1 change: 1 addition & 0 deletions build/pkgs/sphinx_copybutton/install-requires.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sphinx-copybutton
1 change: 1 addition & 0 deletions build/pkgs/sphinx_copybutton/package-version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.5.1
1 change: 1 addition & 0 deletions build/pkgs/sphinx_copybutton/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
standard
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ AC_ARG_ENABLE([doc],
AS_HELP_STRING([--disable-doc],
[disable build of the Sage documentation and packages depending on it]), [
dnl Disable packages needed for docbuilding
for pkg in sage_docbuild alabaster babel snowballstemmer imagesize sphinx sphinxcontrib_devhelp sphinxcontrib_jsmath sphinxcontrib_serializinghtml sphinxcontrib_applehelp sphinxcontrib_htmlhelp sphinxcontrib_qthelp sphinxcontrib_websupport jupyter_sphinx furo; do
for pkg in sage_docbuild alabaster babel snowballstemmer imagesize sphinx sphinxcontrib_devhelp sphinxcontrib_jsmath sphinxcontrib_serializinghtml sphinxcontrib_applehelp sphinxcontrib_htmlhelp sphinxcontrib_qthelp sphinxcontrib_websupport jupyter_sphinx furo sphinx_copybutton; do
AS_VAR_SET([SAGE_ENABLE_$pkg], [$enableval])
done
AS_VAR_IF([enableval], [no], [dnl Disable the docbuild by disabling the install tree for documentation
Expand Down
7 changes: 7 additions & 0 deletions src/sage_docbuild/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
'sphinx.ext.todo',
'sphinx.ext.extlinks',
'sphinx.ext.mathjax',
'sphinx_copybutton',
'IPython.sphinxext.ipython_directive',
'matplotlib.sphinxext.plot_directive',
'jupyter_sphinx',
Expand Down Expand Up @@ -255,6 +256,12 @@ def set_intersphinx_mappings(app, config):
# By default document are not master.
multidocs_is_master = True

# https://sphinx-copybutton.readthedocs.io/en/latest/use.html
copybutton_prompt_text = r"sage: |[.][.][.][.]: |\$ "
copybutton_prompt_is_regexp = True
copybutton_exclude = '.linenos, .c1' # exclude single comments (in particular, # optional!)
copybutton_only_copy_prompt_lines = True

# Options for HTML output
# -----------------------

Expand Down