FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

DOC: add API docs content guidelines to api docs instructions by story645 · Pull Request #30085 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
63 changes: 32 additions & 31 deletions doc/devel/document.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,14 @@ expression in the Matplotlib figure. In these cases, you can use the

.. _writing-docstrings:

Write docstrings
================
Write API documentation
=======================

Most of the API documentation is written in docstrings. These are comment
blocks in source code that explain how the code works.
The API reference documentation describes the library interfaces, e.g. inputs, outputs,
and expected behavior. Most of the API documentation is written in docstrings. These are
comment blocks in source code that explain how the code works. All docstrings should
conform to the `numpydoc docstring guide`_. Much of the ReST_ syntax discussed above
(:ref:`writing-rest-pages`) can be used for links and references.

.. note::

Expand All @@ -412,11 +415,11 @@ blocks in source code that explain how the code works.
you may see in the source code. Pull requests updating docstrings to
the current style are very welcome.

All new or edited docstrings should conform to the `numpydoc docstring guide`_.
Much of the ReST_ syntax discussed above (:ref:`writing-rest-pages`) can be
used for links and references. These docstrings eventually populate the
:file:`doc/api` directory and form the reference documentation for the
library.
The pages in :file:`doc/api` are purely technical definitions of
layout; therefore new API reference documentation should be added to the module
docstrings. This placement keeps all API reference documentation about a module in the
same file. These module docstrings eventually populate the :file:`doc/api` directory
and form the reference documentation for the library.

Example docstring
-----------------
Expand Down Expand Up @@ -866,6 +869,26 @@ Plots can also be directly placed inside docstrings. Details are in
An advantage of this style over referencing an example script is that the
code will also appear in interactive docstrings.

.. _inheritance-diagrams:

Generate inheritance diagrams
-----------------------------

Class inheritance diagrams can be generated with the Sphinx
`inheritance-diagram`_ directive.

.. _inheritance-diagram: https://www.sphinx-doc.org/en/master/usage/extensions/inheritance.html

Example:

.. code-block:: rst

.. inheritance-diagram:: matplotlib.patches matplotlib.lines matplotlib.text
:parts: 2

.. inheritance-diagram:: matplotlib.patches matplotlib.lines matplotlib.text
:parts: 2

.. _writing-examples-and-tutorials:

Write examples and tutorials
Expand Down Expand Up @@ -1151,28 +1174,6 @@ Use the full path for this directive, relative to the doc root at
found by users at ``http://matplotlib.org/stable/old_topic/old_info2``.
For clarity, do not use relative links.


.. _inheritance-diagrams:

Generate inheritance diagrams
-----------------------------

Class inheritance diagrams can be generated with the Sphinx
`inheritance-diagram`_ directive.

.. _inheritance-diagram: https://www.sphinx-doc.org/en/master/usage/extensions/inheritance.html

Example:

.. code-block:: rst

.. inheritance-diagram:: matplotlib.patches matplotlib.lines matplotlib.text
:parts: 2

.. inheritance-diagram:: matplotlib.patches matplotlib.lines matplotlib.text
:parts: 2


Navbar and style
----------------

Expand Down

Back | FazBrowse Home | New Git URL