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 --------