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

Skip to content

Commit f81164a

Browse files
committed
updated documentation guide
svn path=/trunk/matplotlib/; revision=5416
1 parent 6b0c3aa commit f81164a

2 files changed

Lines changed: 80 additions & 26 deletions

File tree

doc/devel/documenting_mpl.rst

Lines changed: 76 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
Documenting Matplotlib
55
**********************
66

7+
Getting Started
8+
===============
9+
710
The documentation for matplotlib is generated from ReStructured Text
811
using the Sphinx_ documentation generation tool. Sphinx-0.4 or later
912
is required. Currently this means we need to install from the svn
@@ -15,56 +18,100 @@ repository by doing::
1518

1619
.. _Sphinx: http://sphinx.pocoo.org/
1720

18-
The documentation sources are found in the doc/ directory in the trunk.
19-
To build the users guid in html format, cd into doc/users_guide and do::
21+
The documentation sources are found in the `doc/` directory in the trunk.
22+
To build the users guide in html format, cd into `doc/users_guide` and do::
2023

2124
python make.py html
2225

26+
or::
27+
28+
./make.py html
29+
2330
you can also pass a ``latex`` flag to make.py to build a pdf, or pass no
24-
arguments to build everything. The same procedure can be followed for
25-
the sources in doc/api_reference.
31+
arguments to build everything.
32+
33+
The output produced by Sphinx can be configured by editing the `conf.py`
34+
file located in the `doc\`.
35+
36+
Organization of Matplotlib's Documentation
37+
==========================================
38+
39+
The actual ReStructured Text files are kept in `doc/users`, `doc/devel`,
40+
`doc/api` and `doc/faq`. The main entry point is `doc/index.rst`, which pulls
41+
in the `index.rst` file for the users guide, developers guide, api reference,
42+
and faqs. The documentation suite is built as a single document in order to
43+
make the most effective use of cross referencing, we want to make navigating
44+
the Matplotlib documentation as easy as possible.
45+
46+
Additional files can be added to the various guides by including their base
47+
file name (the .rst extension is not necessary) in the table of contents.
48+
It is also possible to include other documents through the use of an include
49+
statement, such as::
50+
51+
.. include:: ../../TODO
52+
53+
Formatting
54+
==========
2655

27-
The actual ReStructured Text files are kept in doc/users_guide/source
28-
and doc/api_reference/source. The main entry point is index.rst.
29-
Additional files can be added by including their base file name
30-
(dropping the .rst extension) in the table of contents. It is also
31-
possible to include other documents through the use of an include
32-
statement. For example, in the Developers Guide, index.rst lists
33-
coding_guide, which automatically inserts coding_guide.rst.
56+
The Sphinx website contains plenty of documentation_ concerning ReST markup and
57+
working with Sphinx in general. Here are a few additional things to keep in mind:
3458

35-
Sphinx does not support tables with column- or row-spanning cells for
36-
latex output. Such tables can not be used when documenting matplotlib.
59+
* Sphinx does not support tables with column- or row-spanning cells for
60+
latex output. Such tables can not be used when documenting matplotlib.
3761

38-
Mathematical expressions can be rendered as png images in html, and in
39-
the usual way by latex. For example:
62+
* Mathematical expressions can be rendered as png images in html, and in
63+
the usual way by latex. For example:
4064

41-
``math:`sin(x_n^2)`` yields: :math:`sin(x_n^2)`, and::
65+
``math:`sin(x_n^2)`` yields: :math:`sin(x_n^2)`, and::
4266

4367
.. math::
4468
4569
\int_{-\infty}^{\infty}\frac{e^{i\phi}}{1+x^2\frac{e^{i\phi}}{1+x^2}}``
4670
47-
yields:
71+
yields:
4872

49-
.. math::
73+
.. math::
74+
75+
\int_{-\infty}^{\infty}\frac{e^{i\phi}}{1+x^2\frac{e^{i\phi}}{1+x^2}}
76+
77+
* Interactive IPython sessions can be illustrated in the documentation using
78+
the following directive::
79+
80+
.. sourcecode:: ipython
81+
82+
In [69]: lines = plot([1,2,3])
5083

51-
\int_{-\infty}^{\infty}\frac{e^{i\phi}}{1+x^2\frac{e^{i\phi}}{1+x^2}}
84+
which would yield::
5285

53-
The output produced by Sphinx can be configured by editing the conf.py
54-
files located in the documentation source directories.
86+
.. sourcecode:: ipython
5587

56-
The Sphinx website contains plenty of documentation_ concerning ReST
57-
markup and working with Sphinx in general.
88+
In [69]: lines = plot([1,2,3])
5889

5990
.. _documentation: http://sphinx.pocoo.org/contents.html
6091

92+
93+
Figures
94+
=======
95+
96+
Each guide will have its own figures directory for scripts to generate images
97+
to be included in the dcoumentation. It is not necessary to explicitly save
98+
the figure in the script, a figure will be saved with the same name as the
99+
filename when the documentation is generated.
100+
101+
Any figures that rely on optional system configurations should be generated
102+
with a script residing in doc/static_figs. The resulting figures will be saved
103+
to doc/_static, and will be named based on the name of the script, so we can
104+
avoid unintentionally overwriting any existing figures. Please add a line to
105+
the README in doc/static-figs for any additional requirements necessary to
106+
generate a new figure.
107+
61108
.. _referring-to-mpl-docs:
62109

63110
Referring to mpl documents
64111
==========================
65112

66113
In the documentation, you may want to include to a document in the
67-
matplotlib src, eg a license file, an image file from ``mpl-data``, or an
114+
matplotlib src, eg a license file, an image file from `mpl-data`, or an
68115
example. When you include these files, include them using a symbolic
69116
link from the documentation parent directory. This way, if we
70117
relocate the mpl documentation directory, all of the internal pointers
@@ -77,7 +124,9 @@ the mpl ``examples`` and ``mpl-data``::
77124
mpl_examples -> ../examples
78125

79126

80-
In the ``users`` subdirectory, if I want to refer to a file in the mpl-data directory, I use the symlink direcotry. For example, from ``customizing.rst``::
127+
In the `users` subdirectory, if I want to refer to a file in the mpl-data
128+
directory, I use the symlink directory. For example, from
129+
``customizing.rst``::
81130

82131
.. literalinclude:: ../mpl_data/matplotlibrc
83132

@@ -107,7 +156,8 @@ is better than::
107156

108157
.. _faq-backend
109158

110-
In addition, since underscores are widely used by Sphinx itself, let's prefer hyphens to separate words.
159+
In addition, since underscores are widely used by Sphinx itself, let's prefer
160+
hyphens to separate words.
111161

112162
.. _emacs-helpers:
113163

doc/static_figs/README

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Scripts that require optional system configurations to generate scripts should go here. The
2+
figures will be generated in doc/_static, and will be named based on the name of the script,
3+
so we can avoid unintentionally overwriting any existing figures. Please add a line to this
4+
file for any additional requirements necessary to generate a new figure.

0 commit comments

Comments
 (0)