1- MEP10: Docstring consistency
2- ============================
1+ ==============================
2+ MEP10: Docstring consistency
3+ ==============================
34.. contents ::
45 :local:
56
67Status
7- ------
8+ ======
89
910**Progress **
1011
1112Targeted for 1.3
1213
1314Branches and Pull requests
14- --------------------------
15+ ==========================
1516
1617#1665
1718#1757
1819#1795
1920
2021Abstract
21- --------
22+ ========
2223
2324matplotlib has a great deal of inconsistency between docstrings. This
2425not only makes the docs harder to read, but it is harder on
@@ -36,15 +37,15 @@ Building the documentation takes a long time and uses a `make.py`
3637script rather than a Makefile.
3738
3839Detailed description
39- --------------------
40+ ====================
4041
4142There are number of new tools and conventions available since
4243matplotlib started using Sphinx that make life easier. The following
4344is a list of proposed changes to docstrings, most of which involve
4445these new features.
4546
4647Numpy docstring format
47- ''''''''''''''''''''''
48+ ----------------------
4849
4950`Numpy docstring format
5051<https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt> `_:
@@ -55,7 +56,7 @@ own, but this is a strong choice, as it's well used and understood in
5556the Numpy/Scipy community.
5657
5758Cross references
58- ''''''''''''''''
59+ ----------------
5960
6061Most of the docstrings in matplotlib use explicit "roles" when linking
6162to other items, for example: ``:func:`myfunction` ``. As of Sphinx
@@ -67,7 +68,7 @@ a current module, so links like ```~matplotlib.axes.Axes.set_xlim```
6768could be written as ```~axes.Axes.set_xlim` ``.
6869
6970Overriding signatures
70- '''''''''''''''''''''
71+ ---------------------
7172
7273Many methods in matplotlib use the ``*args `` and ``**kwargs `` syntax
7374to dynamically handle the keyword arguments that are accepted by the
@@ -104,7 +105,7 @@ The explicit signature will replace the actual Python one in the
104105generated documentation.
105106
106107Linking rather than duplicating
107- '''''''''''''''''''''''''''''''
108+ -------------------------------
108109
109110Many of the docstrings include long lists of accepted keywords by
110111interpolating things into the docstring at load time. This makes the
@@ -117,7 +118,7 @@ purpose is for help. The docstrings that refer to these tables should
117118link to them, rather than including them verbatim.
118119
119120autosummary extension
120- '''''''''''''''''''''
121+ ---------------------
121122
122123The Sphinx autosummary extension should be used to generate summary
123124tables, that link to separate pages of documentation. Some classes
@@ -126,7 +127,7 @@ one method per page, whereas smaller classes should have all of their
126127methods together.
127128
128129Examples linking to relevant documentation
129- ''''''''''''''''''''''''''''''''''''''''''
130+ ------------------------------------------
130131
131132The examples, while helpful at illustrating how to use a feature, do
132133not link back to the relevant docstrings. This could be addressed by
@@ -136,15 +137,15 @@ docstrings could easily include references to any other part of the
136137documentation.
137138
138139Documentation using help() vs a browser
139- ''''''''''''''''''''''
140+ ---------------------------------------
140141
141142Using Sphinx markup in the source allows for good-looking docs in your
142143browser, but the markup also makes the raw text returned using help()
143144look terrible. One of the aims of improving the docstrings should be
144145to make both methods of accessing the docs look good.
145146
146147Implementation
147- --------------
148+ ==============
148149
1491501. The numpydoc extensions should be turned on for matplotlib. There
150151 is an important question as to whether these should be included in
@@ -181,12 +182,12 @@ Steps 1, 2, and 3 are interdependent. 4 and 5 may be done
181182independently, though 5 has some dependency on 3.
182183
183184Backward compatibility
184- ----------------------
185+ ======================
185186
186187As this mainly involves docstrings, there should be minimal impact on
187188backward compatibility.
188189
189190Alternatives
190- ------------
191+ ============
191192
192193None yet discussed.
0 commit comments