From 8105ddb5d74ae73b3c61c8093a2fc3e63953b50a Mon Sep 17 00:00:00 2001 From: robin Date: Fri, 13 Sep 2024 16:18:13 +0200 Subject: [PATCH] Add copy button for each code block in the documentation. --- .github/workflows/documentation.yml | 2 +- docs/src/conf.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 8be1ba1..22747c4 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/setup-python@v5 - name: Install dependencies run: | - pip install sphinx sphinx_rtd_theme sphinx-tabs myst_parser numpy k3d vedo colour + pip install sphinx sphinx_rtd_theme sphinx-tabs sphinx_copybutton myst_parser numpy k3d vedo colour - name: Sphinx build run: | sphinx-build docs/src docs/build diff --git a/docs/src/conf.py b/docs/src/conf.py index 2d3fd53..1a83642 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -32,7 +32,8 @@ 'sphinx.ext.autosummary', 'sphinx.ext.viewcode', 'sphinx.ext.extlinks', - 'sphinx_tabs.tabs'] + 'sphinx_tabs.tabs', + 'sphinx_copybutton'] intersphinx_mapping = {'python': ('https://docs.python.org/3/', None), 'sphinx': ('https://www.sphinx-doc.org/en/master/', None),