rstcheck config and precommit & fixed rst linting errors · matplotlib/matplotlib@41d1963 · GitHub
Skip to content

Commit 41d1963

Browse files
committed
rstcheck config and precommit & fixed rst linting errors
1 parent 221f6c2 commit 41d1963

27 files changed

Lines changed: 212 additions & 82 deletions

.pre-commit-config.yaml

Lines changed: 6 additions & 2 deletions

doc/_templates/autofunctions.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ Functions
1414
.. autosummary::
1515
:template: autosummary.rst
1616
:toctree:
17+
1718
{% for item in functions %}{% if item not in ['plotting', 'colormaps'] %}
1819
{{ item }}{% endif %}{% endfor %}
20+
1921
{% endif %}
2022
{% endblock %}

doc/_templates/automodule.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
{{ fullname | escape | underline}}
22

33
{% if fullname in ['mpl_toolkits.axes_grid1.colorbar'] %}
4-
.. To prevent problems with the autosummary for the colorbar doc
5-
treat this separately (sphinx-doc/sphinx/issues/4874)
4+
5+
.. To prevent problems with the autosummary for the colorbar doc treat this
6+
separately (sphinx-doc/sphinx/issues/4874)
7+
68
.. automodule:: {{ fullname }}
79
:members:
810

@@ -21,8 +23,10 @@ Classes
2123
.. autosummary::
2224
:template: autosummary.rst
2325
:toctree:
26+
2427
{% for item in classes %}{% if item not in ['zip', 'map', 'reduce'] %}
2528
{{ item }}{% endif %}{% endfor %}
29+
2630
{% endif %}
2731
{% endblock %}
2832

@@ -38,6 +42,7 @@ Functions
3842

3943
{% for item in functions %}{% if item not in ['zip', 'map', 'reduce'] %}
4044
{{ item }}{% endif %}{% endfor %}
45+
4146
{% endif %}
4247
{% endblock %}
4348
{% endif %}

doc/_templates/autosummary.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66

77
{% if objtype in ['class'] %}
8+
89
.. auto{{ objtype }}:: {{ objname }}
910
:show-inheritance:
1011
:special-members: __call__
@@ -16,11 +17,13 @@
1617

1718
{% if objtype in ['class', 'method', 'function'] %}
1819
{% if objname in ['AxesGrid', 'Scalable', 'HostAxes', 'FloatingAxes',
19-
'ParasiteAxesAuxTrans', 'ParasiteAxes'] %}
20+
'ParasiteAxesAuxTrans', 'ParasiteAxes'] %}
21+
2022
.. Filter out the above aliases to other classes, as sphinx gallery
2123
creates no example file for those (sphinx-gallery/sphinx-gallery#365)
2224
2325
{% else %}
26+
2427
.. minigallery:: {{module}}.{{objname}}
2528
:add-heading:
2629

doc/_templates/autosummary_class_only.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66

77
{% if objtype in ['class'] %}
8+
89
.. auto{{ objtype }}:: {{ objname }}
910
:no-members:
1011

doc/api/next_api_changes/behavior/25775-HZ.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Default antialiasing behavior changes for ``Text`` and ``Annotation``
44
``matplotlib.pyplot.annotate()`` and ``matplotlib.pyplot.text()`` now support parameter *antialiased* when initializing.
55
Examples:
66

7-
.. code-block::
7+
.. code-block:: python
88
99
mpl.text.Text(.5, .5, "foo\nbar", antialiased=True)
1010
plt.text(0.5, 0.5, '6 inches x 2 inches', antialiased=True)

doc/api/prev_api_changes/api_changes_2.1.2.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ didn't handle linewidths or linestyles etc.
1313

1414
This logic did not exist in `.axes.Axes.legend`. It was included (erroneously)
1515
in Matplotlib 2.1.1 when the legend argument parsing was unified
16-
[#9324](https://github.com/matplotlib/matplotlib/pull/9324). This change
16+
`#9324 <https://github.com/matplotlib/matplotlib/pull/9324>`_. This change
1717
removes that check in `.axes.Axes.legend` again to restore the old behavior.
1818

1919
This logic has also been dropped from `.Figure.legend`, where it

doc/api/prev_api_changes/api_changes_3.5.0/behaviour.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ consistently exposes all the attributes and methods related to the line marker
132132
(:ghissue:`11358`). This makes it easy to change the marker features after
133133
instantiating a legend.
134134

135-
.. code::
135+
.. code-block:: python
136136
137137
import matplotlib.pyplot as plt
138138
@@ -147,7 +147,7 @@ instantiating a legend.
147147
The former legend handler for Line2D objects has been renamed
148148
`.HandlerLine2DCompound`. To revert to the previous behaviour, one can use
149149

150-
.. code::
150+
.. code-block:: python
151151
152152
import matplotlib.legend as mlegend
153153
from matplotlib.legend_handler import HandlerLine2DCompound

doc/api/prev_api_changes/api_changes_3.7.0/behaviour.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Now, the halfrange remains fixed when vcenter is changed, and **vmin** and
5151

5252
For example, this is what the values were when changing vcenter previously.
5353

54-
.. code-block::
54+
.. code-block:: python
5555
5656
norm = CenteredNorm(vcenter=0, halfrange=1)
5757
# Move vcenter up by one
@@ -61,7 +61,7 @@ For example, this is what the values were when changing vcenter previously.
6161
6262
and now, with that same example
6363

64-
.. code-block::
64+
.. code-block:: python
6565
6666
norm = CenteredNorm(vcenter=0, halfrange=1)
6767
norm.vcenter = 1

doc/devel/MEP/MEP23.rst

Lines changed: 2 additions & 2 deletions

0 commit comments

Comments
 (0)