Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c9b2ad9

Browse files
committed
Merge branch 'sphinx_gallery' of https://github.com/NelleV/matplotlib into sphinx_gallery
2 parents 102b4a5 + 8b764e7 commit c9b2ad9

139 files changed

Lines changed: 225 additions & 305 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
build
3333
# sphinx build directory
3434
doc/_build
35+
doc/auto_examples
3536
# setup.py dist directory
3637
dist
3738
# Egg metadata
@@ -58,7 +59,6 @@ lib/matplotlib/mpl-data/matplotlibrc
5859
# Documentation generated files #
5960
#################################
6061
doc/examples
61-
doc/_templates/gallery.html
6262
doc/users/installing.rst
6363
doc/_static/matplotlibrc
6464
doc/pyplots/tex_demo.png

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ install:
142142
pip install -ve .
143143
144144
script: source ci/travis/test_script.sh
145+
145146
before_cache:
146147
- rm -rf $HOME/.cache/matplotlib/tex.cache
147148
- rm -rf $HOME/.cache/matplotlib/test_cache

ci/travis/test_script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ if [[ $BUILD_DOCS == false ]]; then
3030
fi
3131
else
3232
cd doc
33-
python make.py html -n 2
33+
python make.py html
3434
# We don't build the LaTeX docs here, so linkchecker will complain
3535
touch build/html/Matplotlib.pdf
3636
# Linkchecker only works with python 2.7 for the time being

doc-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ ipython
1212
mock
1313
colorspacious
1414
pillow
15+
sphinx-gallery

doc/README.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ All of these dependencies *except graphviz* can be installed through pip::
2121

2222
or all of them via conda and pip::
2323

24-
conda install sphinx numpydoc ipython mock graphviz pillow
24+
conda install sphinx numpydoc ipython mock graphviz pillow \
25+
sphinx-gallery
2526
pip install colorspacious
2627

2728
To build the HTML documentation, type ``python make.py html`` in this

doc/_templates/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ <h1>Introduction</h1>
7575
<p>Matplotlib tries to make easy things easy and hard things possible.
7676
You can generate plots, histograms, power spectra, bar charts,
7777
errorcharts, scatterplots, etc., with just a few lines of code.
78-
For a sampling, see the <a href="{{ pathto('users/screenshots') }}">screenshots</a>, <a href="{{ pathto('gallery') }}">thumbnail</a> gallery, and
78+
For a sampling, see the <a href="{{ pathto('users/screenshots')
79+
}}">screenshots</a>, <a href="{{ pathto('auto_examples/index') }}">thumbnail</a> gallery, and
7980
<a href="{{ pathto('examples/index') }}">examples</a> directory</p>
8081

8182
<p>For simple plotting the <tt>pyplot</tt> module provides a
@@ -99,7 +100,7 @@ <h1>Documentation</h1>
99100
</script>
100101

101102
<p>Trying to learn how to do a particular kind of plot? Check out
102-
the <a href="{{ pathto('gallery') }}">gallery</a>, <a href="{{ pathto('examples/index') }}">examples</a>,
103+
the <a href="{{ pathto('auto_examples/index') }}">gallery</a>, <a href="{{ pathto('examples/index') }}">examples</a>,
103104
or the <a href="{{ pathto('api/pyplot_summary') }}">list of plotting
104105
commands</a>.</p>
105106

doc/_templates/layout.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ <h3>{{ _('Navigation') }}</h3>
3939

4040
<li><a href="{{ pathto('index') }}">home</a>|&nbsp;</li>
4141
<li><a href="{{ pathto('examples/index') }}">examples</a>|&nbsp;</li>
42-
<li><a href="{{ pathto('gallery') }}">gallery</a>|&nbsp;</li>
42+
<li><a href="{{ pathto('auto_examples/index') }}">gallery</a>|&nbsp;</li>
4343
<li><a href="{{ pathto('api/pyplot_summary') }}">pyplot</a>|&nbsp;</li>
4444
<li><a href="{{ pathto('contents') }}">docs</a> &raquo;</li>
4545

doc/conf.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@
2929
extensions = ['matplotlib.sphinxext.mathmpl', 'sphinxext.math_symbol_table',
3030
'sphinx.ext.autodoc', 'matplotlib.sphinxext.only_directives',
3131
'sphinx.ext.doctest', 'sphinx.ext.autosummary',
32-
'matplotlib.sphinxext.plot_directive',
3332
'sphinx.ext.inheritance_diagram',
34-
'sphinxext.gen_gallery', 'sphinxext.gen_rst',
33+
'sphinx_gallery.gen_gallery',
34+
'sphinxext.gen_rst',
35+
'matplotlib.sphinxext.plot_directive',
3536
'sphinxext.github',
3637
'numpydoc']
3738

@@ -53,6 +54,12 @@
5354
raise ImportError("No module named numpydoc - you need to install "
5455
"numpydoc to build the documentation.")
5556

57+
try:
58+
import sphinx_gallery
59+
except ImportError:
60+
raise ImportError("No module named sphinx_gallery - you need to install "
61+
"sphinx_gallery to build the documentation.")
62+
5663
try:
5764
import colorspacious
5865
except ImportError:
@@ -96,6 +103,16 @@
96103

97104
autodoc_docstring_signature = True
98105

106+
107+
# Sphinx gallery configuration
108+
sphinx_gallery_conf = {
109+
# path to your examples scripts
110+
'examples_dirs' : '../examples',
111+
# path where to save gallery generated examples
112+
'gallery_dirs' : 'auto_examples'}
113+
114+
plot_gallery = True
115+
99116
# Add any paths that contain templates here, relative to this directory.
100117
templates_path = ['_templates']
101118

@@ -234,7 +251,6 @@
234251
# Additional templates that should be rendered to pages, maps page names to
235252
# template names.
236253
html_additional_pages = {'index': 'index.html',
237-
'gallery':'gallery.html',
238254
'citing': 'citing.html'}
239255

240256
# If false, no module index is generated.

doc/devel/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ We have hundreds of examples in subdirectories of
442442
:file:`matplotlib/examples`, and these are automatically generated
443443
when the website is built to show up both in the `examples
444444
<../examples/index.html>`_ and `gallery
445-
<../gallery.html>`_ sections of the website.
445+
<../auto_examples/index.html>`_ sections of the website.
446446

447447
Any sample data that the example uses should be kept small and
448448
distributed with Matplotlib in the

doc/mpl_toolkits/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ plotting (scatter, surf, line, mesh) tools. Not the fastest or feature
3030
complete 3D library out there, but ships with Matplotlib and thus may be a
3131
lighter weight solution for some use cases.
3232

33-
.. plot:: mpl_examples/mplot3d/contourf3d_demo2.py
33+
.. plot:: auto_examples/mplot3d/plot_contourf3d_2.py
3434

3535
.. _toolkit_axes_grid1:
3636

0 commit comments

Comments
 (0)