Skip to content

Commit e057fd4

Browse files
committed
rstchecking precommit + fixing files with rst errors
1 parent e9f1d7b commit e057fd4

File tree

9 files changed

+25
-15
lines changed

9 files changed

+25
-15
lines changed

.pre-commit-config.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ repos:
2626
- id: no-commit-to-branch #default is master and main
2727
- id: trailing-whitespace
2828
exclude_types: [svg]
29-
3029
- repo: https://github.com/pycqa/flake8
3130
rev: 6.0.0
3231
hooks:
@@ -44,10 +43,21 @@ repos:
4443
"--skip",
4544
"doc/users/project/credits.rst"
4645
]
47-
4846
- repo: https://github.com/pycqa/isort
4947
rev: 5.12.0
5048
hooks:
5149
- id: isort
5250
name: isort (python)
5351
files: ^galleries/tutorials/|^galleries/examples/|^galleries/plot_types/
52+
- repo: https://github.com/rstcheck/rstcheck
53+
rev: v6.2.0
54+
hooks:
55+
- id: rstcheck
56+
additional_dependencies:
57+
- sphinx>=1.8.1
58+
args: [
59+
"--ignore-directives",
60+
"redirect-from, grid, tab-set, plot, mathmpl",
61+
"--ignore-roles",
62+
"rc"
63+
]

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_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/users/next_whats_new/antialiasing_text_annotation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ When *antialiased* is set to ``False``, antialiasing will not be applied to the
66
When *antialiased* is not specified, antialiasing will be set by :rc:`text.antialiased` at the creation time of ``Text`` and ``Annotation`` object.
77
Examples:
88

9-
.. code-block::
9+
.. code-block:: python
1010
1111
mpl.text.Text(.5, .5, "foo\nbar", antialiased=True)
1212
plt.text(0.5, 0.5, '6 inches x 2 inches', antialiased=True)
@@ -15,7 +15,7 @@ Examples:
1515
If the text contains math expression, *antialiased* applies to the whole text.
1616
Examples:
1717

18-
.. code-block::
18+
.. code-block:: python
1919
2020
# no part will be antialiased for the text below
2121
plt.text(0.5, 0.25, r"$I'm \sqrt{x}$", antialiased=False)

doc/users/next_whats_new/boldsym_mathtext.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Supports using the ``\boldsymbol{}`` command in mathtext:
66
To change symbols to bold enclose the text in a font command as
77
shown:
88

9-
.. code-block::
9+
.. code-block:: none
1010
1111
r'$\boldsymbol{a+2+\alpha}$'
1212

doc/users/next_whats_new/mathtext_features.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
To use it to enclose the math in a substack command as shown:
77

8-
.. code-block::
8+
.. code-block:: none
99
1010
r'$\sum_{\substack{1\leq i\leq 3\\ 1\leq j\leq 5}}$'
1111
@@ -23,7 +23,7 @@ The ``\middle`` delimiter has been added, and can now be used with the
2323
To use the middle command enclose it in between the ``\left`` and
2424
``\right`` delimiter command as shown:
2525

26-
.. code-block::
26+
.. code-block:: none
2727
2828
r'$\left( \frac{a}{b} \middle| q \right)$'
2929

doc/users/next_whats_new/updated_mathtext.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Supports use of bold-italic font style in mathtext using the ``\mathbfit{}`` com
66
To change font to bold and italic enclose the text in a font command as
77
shown:
88

9-
.. code-block::
9+
.. code-block:: python
1010
11-
r'$\mathbfit{\eta \leq C(\delta(\eta))}$
11+
r'$\mathbfit{\eta \leq C(\delta(\eta))}$'
1212
1313
.. math::
1414
\mathbfit{\eta \leq C(\delta(\eta))}

doc/users/prev_whats_new/whats_new_3.4.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ display an image of the colormap.
494494

495495
.. only:: html
496496

497-
.. code-block::
497+
.. code-block:: ipython
498498
499499
In[1]: cmap = plt.get_cmap('viridis').with_extremes(bad='r', under='g', over='b')
500500

doc/users/prev_whats_new/whats_new_3.5.0.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ Simplifying the font setting for usetex mode
284284
Now the :rc:`font.family` accepts some font names as value for a more
285285
user-friendly setup.
286286

287-
.. code-block::
287+
.. code-block:: python
288288
289289
plt.rcParams.update({
290290
"text.usetex": True,
@@ -561,7 +561,7 @@ to block callback signals from being processed by the ``CallbackRegistry``.
561561
The optional keyword, *signal*, can be used to block a specific signal
562562
from being processed and let all other signals pass.
563563

564-
.. code-block::
564+
.. code-block:: python
565565
566566
import matplotlib.pyplot as plt
567567

0 commit comments

Comments
 (0)