From 4b2e2cf69201e97775c787ae49077a175d6abcfe Mon Sep 17 00:00:00 2001 From: martinRenou Date: Mon, 20 Dec 2021 14:22:19 +0100 Subject: [PATCH] Make docs executable --- docs/environment.yml | 1 + docs/source/conf.py | 13 ++++++++++--- docs/source/usage.rst | 5 +++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/environment.yml b/docs/environment.yml index fe1b95d4d..0dc0e2e0c 100644 --- a/docs/environment.yml +++ b/docs/environment.yml @@ -6,4 +6,5 @@ dependencies: - pandas - bqplot - sphinx_rtd_theme + - sphinx_thebe - jupyter_sphinx diff --git a/docs/source/conf.py b/docs/source/conf.py index 982c56e59..e4663b1a8 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -45,6 +45,7 @@ 'sphinx.ext.viewcode', 'sphinx.ext.napoleon', 'jupyter_sphinx', + 'sphinx_thebe' ] autosummary_generate = True @@ -65,9 +66,6 @@ """ -# The encoding of source files. -#source_encoding = 'utf-8-sig' - # The master toctree document. master_doc = 'index' @@ -98,6 +96,15 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] htmlhelp_basename = 'bqplotdoc' +# -- Options for thebe --------------------------------------------- + +thebe_config = { + "always_load": False, + "selector": "div.jupyter_cell", + "selector_output": "div.cell_output", + "repository_url": "https://github.com/bqplot/bqplot", + "repository_branch": "stable", +} # -- Options for LaTeX output --------------------------------------------- diff --git a/docs/source/usage.rst b/docs/source/usage.rst index 98a8fbb10..9347dffa3 100644 --- a/docs/source/usage.rst +++ b/docs/source/usage.rst @@ -1,6 +1,11 @@ Usage ===== +The following code examples are static, but you can make them executable and test bqplot +by clicking the following button: + +.. thebe-button:: Click me! + Examples --------