Skip to content

Commit

Permalink
doc: use sphinx-gallery for short examples
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeff committed Mar 28, 2019
1 parent dbdaaa1 commit 2798f99
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -25,7 +25,8 @@ output/*.html
output/*/index.html

# Sphinx documentation
doc/_build
/doc/_build
/doc/examples/

# Vim swap files
.*.swp
Expand Down
23 changes: 18 additions & 5 deletions doc/conf.py
Expand Up @@ -2,11 +2,13 @@

import pygsp

extensions = ['sphinx.ext.viewcode',
'sphinx.ext.autosummary',
'sphinx.ext.mathjax',
'sphinx.ext.inheritance_diagram',
'sphinxcontrib.bibtex']
extensions = [
'sphinx.ext.viewcode',
'sphinx.ext.autosummary',
'sphinx.ext.mathjax',
'sphinx.ext.inheritance_diagram',
'sphinxcontrib.bibtex',
]

extensions.append('sphinx.ext.autodoc')
autodoc_default_flags = ['members', 'undoc-members']
Expand Down Expand Up @@ -39,6 +41,17 @@
from pygsp import graphs, filters, utils, plotting
"""

extensions.append('sphinx_gallery.gen_gallery')
sphinx_gallery_conf = {
'examples_dirs': '../examples',
'gallery_dirs': 'examples',
'filename_pattern': '/',
'reference_url': {
'pygsp': None,
},
'show_memory': True,
}

exclude_patterns = ['_build']
source_suffix = '.rst'
master_doc = 'index'
Expand Down
1 change: 1 addition & 0 deletions doc/index.rst
Expand Up @@ -5,6 +5,7 @@

Home <self>
tutorials/index
examples/index
reference/index
contributing
history
Expand Down
3 changes: 3 additions & 0 deletions examples/README.txt
@@ -0,0 +1,3 @@
========
Examples
========
2 changes: 2 additions & 0 deletions setup.py
Expand Up @@ -61,6 +61,8 @@
'sphinx',
'numpydoc',
'sphinxcontrib-bibtex',
'sphinx-gallery',
'memory_profiler',
'sphinx-rtd-theme',
# Build and upload packages.
'wheel',
Expand Down

0 comments on commit 2798f99

Please sign in to comment.