8000 More cleanup · matplotlib/matplotlib@6bd1367 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6bd1367

Browse files
committed
More cleanup
1 parent 5aeb87d commit 6bd1367

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

doc/devel/documenting_mpl.rst

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _documenting-matplotlib:
22

3-
===========================================
4-
Developer's tips for documenting Matplotlib
5-
===========================================
3+
================================
4+
Developer's tips for documenting
5+
================================
66

77
Getting started
88
===============
@@ -54,7 +54,7 @@ Building the docs
5454

5555
The documentation sources are found in the :file:`doc/` directory in
5656
the trunk. To build the documentation in html format, cd into
57-
:file:`doc/` and run::
57+
:file:`doc/` and run:
5858

5959
.. code-block:: sh
6060
@@ -72,16 +72,15 @@ The list of comamnds and flags for ``make.py`` can be listed by running
7272
many warnings at once.
7373

7474

75-
Organization of Matplotlib's documentation
76-
==========================================
75+
Documentation organization
76+
==========================
7777

7878
The actual reStructured Text files are kept in :file:`doc/users`,
7979
:file:`doc/devel`, :file:`doc/api` and :file:`doc/faq`. The main entry point is
8080
:file:`doc/index.rst`, which pulls in the :file:`index.rst` file for the users
8181
guide, developers guide, api reference, and FAQs. The documentation suite is
8282
built as a single document in order to make the most effective use of cross
83-
referencing (we want to make navigating the Matplotlib documentation as easy as
84-
possible).
83+
referencing.
8584

8685
Additional files can be added to the various guides by including their base
8786
file name (the .rst extension is not necessary) in the table of contents.
@@ -95,11 +94,14 @@ statement, such as::
9594
Formatting
9695
==========
9796

98-
All new or edited docstrings should conform to the numpydoc guidelines. These
99-
split the docstring down into a number of sections - see
97+
Most documentaiton lives in "docstrings". These are comment blocks in the source
98+
code that explain how the code works. All new or edited docstrings should
99+
conform to the numpydoc guidelines. These split the docstring into a number
100+
of sections - see
100101
https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt for more
101-
details and a guide to the way docstrings should be written. A simple example
102-
docstring looks like:
102+
details and a guide to how docstrings should be formatted.
103+
104+
An example docstring looks like:
103105

104106
.. code-block:: python
105107
@@ -142,8 +144,8 @@ working with Sphinx in general.
142144

143145
Function arguments
144146
------------------
145-
Function arguments and keywords should be referred to using the
146-
``*emphasis*`` role. This will keep Matplotlib's documentation consistent
147+
Function arguments and keywords within docstrings should be referred to using
148+
the ``*emphasis*`` role. This will keep Matplotlib's documentation consistent
147149
with Python's documentation:
148150

149151
.. code-block:: rst
@@ -221,26 +223,26 @@ Figures
221223
Dynamically generated figures
222224
-----------------------------
223225

224-
Figures can be automatically generated from scripts and included in
225-
the docs. It is not necessary to explicitly save the figure in the
226-
script, this will be done automatically at build time to ensure that
227-
the code that is included runs and produces the advertised figure.
226+
Figures can be automatically generated from scripts and included in the docs.
227+
It is not necessary to explicitly save the figure from the script; this will be
228+
done automatically when the docs are built to ensure that the code that is
229+
included runs and produces the advertised figure.
228230

229-
The path should be relative to the ``doc`` directory. Any plots
230-
specific to the documentation should be added to the ``doc/mpl_examples/pyplots``
231-
directory and committed to git. Plots from the ``examples`` directory
232-
may be referenced through the symlink ``mpl_examples`` in the ``doc``
233-
directory, e.g.:
231+
Plotting code should be added to the :file:`examples` directory. Plots from
232+
the :file:`examples` directory may be referenced through the symlink
233+
``mpl_examples`` in the ``doc`` directory, e.g.:
234234

235235
.. code-block:: rst
236236
237-
.. plot:: mpl_examples/pylab_examples/simple_plot.py
237+
.. plot:: mpl_examples/lines_bars_and_markers/fill.py
238238
239239
The ``:scale:`` directive rescales the image to some percentage of the
240240
original size, though we don't recommend using this in most cases
241241
since it is probably better to choose the correct figure size and dpi
242242
in Matplotlib and let it handle the scaling.
243243

244+
To include plots in docstrings, see the following guide:
245+
244246
Plot directive documentation
245247
''''''''''''''''''''''''''''
246248

@@ -250,10 +252,8 @@ Examples
250252
--------
251253

252254
The source of the files in the ``examples`` directory are
253-
automatically included in the HTML docs. An image is generated and
254-
included for all examples in the ``api`` and ``pylab_examples``
255-
directories. To exclude the example from having an image rendered,
256-
insert the following special comment anywhere in the script:
255+
automatically included in the HTML docs. To exclude the example from having an
256+
image rendered, insert the following special comment anywhere in the script:
257257

258258
.. code-block:: python
259259

0 commit comments

Comments
 (0)
0