diff --git a/.gitignore b/.gitignore index c6c6ba6d..f56c8f74 100644 --- a/.gitignore +++ b/.gitignore @@ -25,7 +25,8 @@ output/*.html output/*/index.html # Sphinx documentation -doc/_build +/doc/_build +/doc/examples/ # Vim swap files .*.swp diff --git a/doc/conf.py b/doc/conf.py index 00bd4bfd..fc95a1cc 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -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'] @@ -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' diff --git a/doc/index.rst b/doc/index.rst index 4fab6d08..1ebdcf59 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -5,6 +5,7 @@ Home tutorials/index + examples/index reference/index contributing history diff --git a/examples/README.txt b/examples/README.txt new file mode 100644 index 00000000..b90c0e1c --- /dev/null +++ b/examples/README.txt @@ -0,0 +1,3 @@ +======== +Examples +======== diff --git a/setup.py b/setup.py index 9cef6fc4..2ed970f9 100644 --- a/setup.py +++ b/setup.py @@ -61,6 +61,8 @@ 'sphinx', 'numpydoc', 'sphinxcontrib-bibtex', + 'sphinx-gallery', + 'memory_profiler', 'sphinx-rtd-theme', # Build and upload packages. 'wheel',