Skip to content

Commit ede1959

Browse files
committed
DOC: documentated and simplified doc build
- Removed basemap example, as it contains a basemap dependency. Basemap being currently quite hard to install, it adds unecessary burden for contributors to the documentation. - Documented the documentation build dependencies. - Checks that dependencies are installed *before* running the build. - Documented build options. fix #7040
1 parent 5f553bc commit ede1959

File tree

4 files changed

+52
-78
lines changed

4 files changed

+52
-78
lines changed

doc/README.txt

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,51 @@
11
maptlotlib documentation
22
========================
33

4+
5+
Building the documentation
6+
--------------------------
7+
8+
Dependencies:
9+
10+
* sphinx > 1.0
11+
* numpydoc
12+
* ipython
13+
* mock
14+
* colorspacious
15+
16+
All of these dependencies can be installed through pip::
17+
18+
pip install sphinx numpydoc ipython mock colorspacious
19+
20+
or conda::
21+
22+
conda install sphinx numpydoc ipython mock colorspacious
23+
24+
To build the HTML documentation, type ``python make.py html`` in this
25+
directory. The top file of the results will be ./build/html/index.html
26+
27+
**Note that Sphinx uses the installed version of the package to build the
28+
documentation**: matplotlib must be installed *before* the docs can be
29+
generated. Even if that is the case, one of the files needed to do this,
30+
'../lib/matplotlib/mpl-data/matplotlibrc', is not version controlled, but
31+
created when matplotlib is built. This means that the documentation cannot be
32+
generated immediately after checking out the source code, even if matplotlib
33+
is installed on your system: you will have to run ``python setup.py build``
34+
first.
35+
36+
You can build the documentation with several options:
37+
38+
* `--small` saves figures in low resolution.
39+
* `--allowsphinxwarnings`: Don't turn Sphinx warnings into errors.
40+
* `-n N` enables parallel build of the documentation using N process.
41+
42+
Organization
43+
-------------
44+
445
This is the top level build directory for the matplotlib
546
documentation. All of the documentation is written using sphinx, a
647
python documentation system built on top of ReST. This directory contains
748

8-
949
* users - the user documentation, e.g., plotting tutorials, configuration
1050
tips, etc.
1151

@@ -33,21 +73,3 @@ python documentation system built on top of ReST. This directory contains
3373
* mpl_examples - a link to the matplotlib examples in case any
3474
documentation wants to literal include them
3575

36-
To build the HTML documentation, install sphinx (1.0 or greater
37-
required), then type "python make.py html" in this directory. Wait
38-
for the initial run (which builds the example gallery) to be done,
39-
then run "python make.py html" again. The top file of the results will
40-
be ./build/html/index.html
41-
42-
Note that Sphinx uses the installed version of the package to build
43-
the documentation, so matplotlib must be installed *before* the docs
44-
can be generated. Even if that is the case, one of the files needed
45-
to do this, '../lib/matplotlib/mpl-data/matplotlibrc', is not version
46-
controlled, but created when matplotlib is built. This means that the
47-
documentation cannot be generated immediately after checking out the
48-
source code, even if matplotlib is installed on your system: you will
49-
have to run ``python setup.py build`` first.
50-
51-
To build a smaller version of the documentation (without
52-
high-resolution PNGs and PDF examples), type "python make.py --small
53-
html".

doc/conf.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,17 @@
5252
raise ImportError("No module named numpydoc - you need to install "
5353
"numpydoc to build the documentation.")
5454

55+
try:
56+
import colorspacious
57+
except ImportError:
58+
raise ImportError("No module named colorspacious - you need to install "
59+
"colorspacious to build the documentation")
60+
61+
try:
62+
import mock
63+
except ImportError:
64+
raise ImportError("No module named mock - you need to install "
65+
"mock to build the documentation")
5566

5667
autosummary_generate = True
5768

doc/pyplots/plotmap.py

Lines changed: 0 additions & 49 deletions
This file was deleted.

doc/users/screenshots.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -197,16 +197,6 @@ The following example emulates one of the financial plots in
197197

198198
.. plot:: mpl_examples/pylab_examples/finance_work2.py
199199

200-
201-
.. _screenshots_basemap_demo:
202-
203-
Basemap demo
204-
============
205-
206-
Jeff Whitaker's :ref:`toolkit_basemap` add-on toolkit makes it possible to plot data on many different map projections. This example shows how to plot contours, markers and text on an orthographic projection, with NASA's "blue marble" satellite image as a background.
207-
208-
.. plot:: pyplots/plotmap.py
209-
210200
.. _screenshots_log_demo:
211201

212202
Log plots

0 commit comments

Comments
 (0)