From 98155263a14c4668ae47d0cfee2a2c59e97467ca Mon Sep 17 00:00:00 2001 From: Johannes Kaisinger Date: Fri, 19 Jan 2024 21:05:48 +0100 Subject: [PATCH] Add sphinx-copybutton --- doc/requirements.txt | 1 + doc/source/conf.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 544739b5..2fd39a11 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,4 +1,5 @@ sphinx>=7.2.6 +sphinx-copybutton numpy scipy pandas diff --git a/doc/source/conf.py b/doc/source/conf.py index 3c1eb275..725d2a1b 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -19,7 +19,7 @@ import re # Get the version number for this commmit (including alpha/beta/rc tags) -release = re.sub('^v', '', os.popen('git describe').read().strip()) +release = re.sub('^v', '', os.popen('git describe --tags').read().strip()) # The short X.Y.Z version version = re.sub(r'(\d+\.\d+\.\d+(.post\d+)?)(.*)', r'\1', release) @@ -33,7 +33,7 @@ 'sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.napoleon', 'sphinx.ext.intersphinx', 'sphinx.ext.imgmath', 'sphinx.ext.autosummary', 'nbsphinx', 'numpydoc', - 'sphinx.ext.doctest' + 'sphinx.ext.doctest', 'sphinx_copybutton' ] # scan documents for autosummary directives and generate stub pages for each. autosummary_generate = True