Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8ef22df

Browse filesBrowse files
dstansbyMeeseeksDev[bot]
authored andcommitted
Backport PR #9875: Additions to the documentation guide
1 parent 7bf1a31 commit 8ef22df
Copy full SHA for 8ef22df

File tree

Expand file treeCollapse file tree

1 file changed

+48
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+48
-0
lines changed

‎doc/devel/documenting_mpl.rst

Copy file name to clipboardExpand all lines: doc/devel/documenting_mpl.rst
+48Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,54 @@ An example docstring looks like:
139139
The Sphinx website also contains plenty of documentation_ concerning ReST
140140
markup and working with Sphinx in general.
141141

142+
.. note::
143+
144+
Some parts of the documentation do not yet conform to the current
145+
documentation style. If in doubt, follow the rules given here and not what
146+
you may see in the source code. Pull requests updating docstrings to
147+
the current style are very welcome.
148+
149+
Additional formatting conventions
150+
---------------------------------
151+
152+
There are some additional conventions, not handled by numpydoc and the Sphinx
153+
guide:
154+
155+
* We do not have a convention whether to use single-quotes or double-quotes.
156+
There is a mixture of both in the current code. Please leave them as they are.
157+
158+
* Long parameter lists should be wrapped using a ``\`` for continuation and
159+
starting on the new line without any indent:
160+
161+
.. code-block:: python
162+
163+
def add_axes(self, *args, **kwargs):
164+
"""
165+
...
166+
167+
Parameters
168+
----------
169+
projection :
170+
['aitoff' | 'hammer' | 'lambert' | 'mollweide' | \
171+
'polar' | 'rectilinear'], optional
172+
The projection type of the axes.
173+
174+
Alternatively, you can describe the valid parameter values in a dedicated
175+
section of the docstring.
176+
177+
* Generally, do not add markup to types for ``Parameters`` and ``Returns``.
178+
This is usually not needed because Sphinx will link them automatically and
179+
would unnecessarily clutter the docstring. However, it does seem to fail in
180+
some situations. If you encounter such a case, you are allowed to add markup:
181+
182+
.. code-block:: rst
183+
184+
Returns
185+
-------
186+
lines : `~matplotlib.collections.LineCollection`
187+
188+
189+
142190
Linking to other code
143191
---------------------
144192
To link to other methods, classes, or modules in Matplotlib you can encase

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.