Skip to content

Commit

Permalink
docs: use nbsphix+sphinx-gallery (#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenbreddels authored Mar 30, 2020
1 parent fad27f9 commit b627a5e
Show file tree
Hide file tree
Showing 21 changed files with 9,087 additions and 13,899 deletions.
7,977 changes: 0 additions & 7,977 deletions docs/source/animation.ipynb

This file was deleted.

780 changes: 0 additions & 780 deletions docs/source/bokeh.ipynb

This file was deleted.

22 changes: 16 additions & 6 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'jupyter_sphinx.embed_widgets',
'sphinx_gallery.load_style',
'nbsphinx',
]

Expand Down Expand Up @@ -145,12 +146,9 @@
#html_theme = 'alabaster'


try:
import sphinx_rtd_theme
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
except:
print "rtd theme not found"
import sphinx_rtd_theme
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]


# Theme options are theme-specific and customize the look and feel of a theme
Expand Down Expand Up @@ -373,3 +371,15 @@

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None, 'pythreejs': ('https://pythreejs.readthedocs.io/en/latest/', None)}


nbsphinx_thumbnails = {
'examples/scatter': 'examples/screenshot/scatter.png',
'examples/volshow': 'examples/screenshot/volshow-head.png',
'examples/mesh': 'examples/screenshot/mesh.png',
'examples/animation': 'examples/screenshot/wave.gif',
'examples/mcmc': 'examples/screenshot/mcmc.gif',
'examples/bqplot': 'examples/screenshot/bqplot.png',
'examples/bokeh': 'examples/screenshot/bokeh.png',
}
exclude_patterns = ['**.ipynb_checkpoints']
2,482 changes: 0 additions & 2,482 deletions docs/source/example_mcmc.ipynb

This file was deleted.

25 changes: 14 additions & 11 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
Examples
========
.. ipywidgets-setup::
.. nbgallery::
:caption: Examples of using ipyvolume:

from ipywidgets import VBox, jsdlink, IntSlider, Button
import ipyvolume
import ipyvolume.pylab as p3
import numpy as np
examples/scatter
examples/volshow
examples/mesh
examples/animation
examples/bqplot
examples/bokeh

.. toctree::
:maxdepth: 2

bokeh
bqplot
example_mcmc
Feel free to contribute new examples:

* Add a notebook to `docs/source/examples`
* Take a screenshot (of screencapture) and put it at `docs/source/examples/screenshot`.
* Make a reference to the screenshot in the notebook, e.g. a markdown cell containing `[screenshot](screenshot/myexample.png)`
* Add an entry in `docs/source/conf.py`.
* Open a pull request at https://github.com/maartenbreddels/ipyvolume
Loading

0 comments on commit b627a5e

Please sign in to comment.