Skip to content

Commit e3042ab

Browse files
authored
Merge pull request #11611 from timhoffm/fix-doc-css
DOC: Fix css for parameter types
2 parents 2887c49 + 18b9525 commit e3042ab

File tree

2 files changed

+84
-81
lines changed

2 files changed

+84
-81
lines changed

doc/_static/mpl.css

-4
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,6 @@ dl.glossary dt {
147147
font-size: 1.1em;
148148
}
149149

150-
dl.docutils dt {
151-
font-weight: bold;
152-
}
153-
154150
pre a {
155151
color: inherit;
156152
text-decoration: none;

doc/devel/documenting_mpl.rst

+84-77
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Writing documentation
55
=====================
66

77
.. contents:: Contents
8-
:depth: 2
8+
:depth: 3
99
:local:
1010
:backlinks: top
1111
:class: multicol-toc
@@ -387,123 +387,130 @@ and the Sphinx_ documentation. Some Matplotlib-specific formatting conventions
387387
to keep in mind:
388388

389389
Function arguments
390-
Function arguments and keywords within docstrings should be referred to
391-
using the ``*emphasis*`` role. This will keep Matplotlib's documentation
392-
consistent with Python's documentation:
390+
~~~~~~~~~~~~~~~~~~
391+
Function arguments and keywords within docstrings should be referred to
392+
using the ``*emphasis*`` role. This will keep Matplotlib's documentation
393+
consistent with Python's documentation:
393394

394-
.. code-block:: rst
395+
.. code-block:: rst
395396
396-
If *linestyles* is *None*, the 'solid' is used.
397+
If *linestyles* is *None*, the 'solid' is used.
397398
398-
Do not use the ```default role``` or the ````literal```` role:
399+
Do not use the ```default role``` or the ````literal```` role:
399400

400-
.. code-block:: rst
401+
.. code-block:: rst
401402
402-
Neither `argument` nor ``argument`` should be used.
403+
Neither `argument` nor ``argument`` should be used.
403404
404405
405406
Quotes for strings
406-
Matplotlib does not have a convention whether to use single-quotes or
407-
double-quotes. There is a mixture of both in the current code.
407+
~~~~~~~~~~~~~~~~~~
408+
Matplotlib does not have a convention whether to use single-quotes or
409+
double-quotes. There is a mixture of both in the current code.
408410

409-
Use simple single or double quotes when giving string values, e.g.:: rst
411+
Use simple single or double quotes when giving string values, e.g.:: rst
410412

411-
.. code-block:: rst
413+
.. code-block:: rst
412414
413-
If 'tight', try to figure out the tight bbox of the figure.
415+
If 'tight', try to figure out the tight bbox of the figure.
414416
415417
Parameter type descriptions
416-
The main goal for parameter type descriptions is to be readable and
417-
understandable by humans. If the possible types are too complex use a
418-
simplification for the type description and explain the type more
419-
precisely in the text.
418+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
419+
The main goal for parameter type descriptions is to be readable and
420+
understandable by humans. If the possible types are too complex use a
421+
simplification for the type description and explain the type more
422+
precisely in the text.
420423

421-
Generally, the `numpydoc docstring guide`_ conventions apply. The following
422-
rules expand on them where the numpydoc conventions are not specific.
424+
Generally, the `numpydoc docstring guide`_ conventions apply. The following
425+
rules expand on them where the numpydoc conventions are not specific.
423426

424-
Use ``float`` for a type that can be any number.
427+
Use ``float`` for a type that can be any number.
425428

426-
Use ``array-like`` for homogeneous numeric sequences, which could
427-
typically be a numpy.array. Dimensionality may be specified using ``2D``,
428-
``3D``, ``n-dimensional``. If you need to have variables denoting the
429-
sizes of the dimensions, use capital letters in brackets
430-
(``array-like (M, N)``). When refering to them in the text they are easier
431-
read and no special formatting is needed.
429+
Use ``array-like`` for homogeneous numeric sequences, which could
430+
typically be a numpy.array. Dimensionality may be specified using ``2D``,
431+
``3D``, ``n-dimensional``. If you need to have variables denoting the
432+
sizes of the dimensions, use capital letters in brackets
433+
(``array-like (M, N)``). When refering to them in the text they are easier
434+
read and no special formatting is needed.
432435

433-
``float`` is the implicit default dtype for array-likes. For other dtypes
434-
use ``array-like of int``.
436+
``float`` is the implicit default dtype for array-likes. For other dtypes
437+
use ``array-like of int``.
435438

436-
Some possible uses::
439+
Some possible uses::
437440

438-
2D array-like
439-
array-like (N)
440-
array-like (M, N)
441-
array-like (M, N, 3)
442-
array-like of int
441+
2D array-like
442+
array-like (N)
443+
array-like (M, N)
444+
array-like (M, N, 3)
445+
array-like of int
443446

444-
Non-numeric homogeneous sequences are described as lists, e.g.::
447+
Non-numeric homogeneous sequences are described as lists, e.g.::
445448

446-
list of str
447-
list of `.Artist`
449+
list of str
450+
list of `.Artist`
448451

449452
Referencing types
450-
Generally, the rules from referring-to-other-code_ apply. More specifically:
453+
~~~~~~~~~~~~~~~~~
454+
Generally, the rules from referring-to-other-code_ apply. More specifically:
451455

452-
Use full references ```~matplotlib.colors.Normalize``` with an
453-
abbreviation tilde in parameter types. While the full name helps the
454-
reader of plain text docstrings, the HTML does not need to show the full
455-
name as it links to it. Hence, the ``~``-shortening keeps it more readable.
456+
Use full references ```~matplotlib.colors.Normalize``` with an
457+
abbreviation tilde in parameter types. While the full name helps the
458+
reader of plain text docstrings, the HTML does not need to show the full
459+
name as it links to it. Hence, the ``~``-shortening keeps it more readable.
456460

457-
Use abbreviated links ```.Normalize``` in the text.
461+
Use abbreviated links ```.Normalize``` in the text.
458462

459-
.. code-block:: rst
463+
.. code-block:: rst
460464
461-
norm : `~matplotlib.colors.Normalize`, optional
462-
A `.Normalize` instance is used to scale luminance data to 0, 1.
465+
norm : `~matplotlib.colors.Normalize`, optional
466+
A `.Normalize` instance is used to scale luminance data to 0, 1.
463467
464468
``See also`` sections
465-
Sphinx automatically links code elements in the definition blocks of ``See
466-
also`` sections. No need to use backticks there::
469+
~~~~~~~~~~~~~~~~~~~~~
470+
Sphinx automatically links code elements in the definition blocks of ``See
471+
also`` sections. No need to use backticks there::
467472

468-
See also
469-
--------
470-
vlines : vertical lines
471-
axhline: horizontal line across the axes
473+
See also
474+
--------
475+
vlines : vertical lines
476+
axhline: horizontal line across the axes
472477

473478
Wrapping parameter lists
474-
Long parameter lists should be wrapped using a ``\`` for continuation and
475-
starting on the new line without any indent:
479+
~~~~~~~~~~~~~~~~~~~~~~~~
480+
Long parameter lists should be wrapped using a ``\`` for continuation and
481+
starting on the new line without any indent:
476482

477-
.. code-block:: python
483+
.. code-block:: python
478484
479-
def add_axes(self, *args, **kwargs):
480-
"""
481-
...
485+
def add_axes(self, *args, **kwargs):
486+
"""
487+
...
482488
483-
Parameters
484-
----------
485-
projection :
486-
{'aitoff', 'hammer', 'lambert', 'mollweide', 'polar', \
487-
'rectilinear'}, optional
488-
The projection type of the axes.
489+
Parameters
490+
----------
491+
projection :
492+
{'aitoff', 'hammer', 'lambert', 'mollweide', 'polar', \
493+
'rectilinear'}, optional
494+
The projection type of the axes.
489495
490-
...
491-
"""
496+
...
497+
"""
492498
493-
Alternatively, you can describe the valid parameter values in a dedicated
494-
section of the docstring.
499+
Alternatively, you can describe the valid parameter values in a dedicated
500+
section of the docstring.
495501

496502
rcParams
497-
rcParams can be referenced with the custom ``:rc:`` role:
498-
:literal:`:rc:\`foo\`` yields ``rcParams["foo"]``. Use `= [default-val]`
499-
to indicate the default value of the parameter. The default value should be
500-
literal, i.e. enclosed in double backticks. For simplicity these may be
501-
omitted for string default values.
503+
~~~~~~~~
504+
rcParams can be referenced with the custom ``:rc:`` role:
505+
:literal:`:rc:\`foo\`` yields ``rcParams["foo"]``. Use `= [default-val]`
506+
to indicate the default value of the parameter. The default value should be
507+
literal, i.e. enclosed in double backticks. For simplicity these may be
508+
omitted for string default values.
502509

503-
.. code-block:: rst
510+
.. code-block:: rst
504511
505-
If not provided, defaults to :rc:`figure.figsize` = ``[6.4, 4.8]``.
506-
If not provided, defaults to :rc:`figure.facecolor` = 'w'.
512+
If not provided, defaults to :rc:`figure.figsize` = ``[6.4, 4.8]``.
513+
If not provided, defaults to :rc:`figure.facecolor` = 'w'.
507514
508515
Deprecated formatting conventions
509516
---------------------------------

0 commit comments

Comments
 (0)