Skip to content

Commit 4b7f801

Browse files
committed
Fix some broken doc refs.
1 parent 6b1d416 commit 4b7f801

File tree

21 files changed

+117
-379
lines changed

21 files changed

+117
-379
lines changed

doc/api/prev_api_changes/api_changes_3.0.0.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,11 @@ being incorrectly modified by these functions.
302302

303303

304304

305-
`CallbackRegistry` now stores callbacks using stdlib's `WeakMethod`\s
306-
---------------------------------------------------------------------
305+
`CallbackRegistry` now stores callbacks using stdlib's `.WeakMethod`\s
306+
----------------------------------------------------------------------
307307

308308
In particular, this implies that ``CallbackRegistry.callbacks[signal]`` is now
309-
a mapping of callback ids to `WeakMethod`\s (i.e., they need to be first called
309+
a mapping of callback ids to `.WeakMethod`\s (i.e., they need to be first called
310310
with no arguments to retrieve the method itself).
311311

312312

@@ -544,8 +544,8 @@ Proprietary sphinx directives
544544
`````````````````````````````
545545

546546
The matplotlib documentation used the proprietary sphinx directives
547-
`.. htmlonly::`, and `.. latexonly::`. These have been replaced with the
548-
standard sphinx directives `.. only:: html` and `.. only:: latex`. This
547+
``.. htmlonly::``, and ``.. latexonly::``. These have been replaced with the
548+
standard sphinx directives ``.. only:: html`` and ``.. only:: latex``. This
549549
change will not affect any users. Only downstream package maintainers, who
550550
have used the proprietary directives in their docs, will have to switch to the
551551
sphinx directives.

doc/devel/MEP/MEP11.rst

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ alongside matplotlib. This MEP aims to resolve some problems with
3232
that approach, bring some consistency, while continuing to make
3333
installation convenient.
3434

35-
At the time that was initially done, `setuptools`, `easy_install` and
36-
`PyPI` were not mature enough to be relied on. However, at present,
35+
At the time that was initially done, setuptools_, easy_install_ and
36+
PyPI_ were not mature enough to be relied on. However, at present,
3737
we should be able to safely leverage the "modern" versions of those
38-
tools, `distribute` and `pip`.
38+
tools, distribute_ and pip_.
3939

4040
While matplotlib has dependencies on both Python libraries and C/C++
4141
libraries, this MEP addresses only the Python libraries so as to not
@@ -59,38 +59,38 @@ matplotlib depends on the following third-party Python libraries:
5959
Current behavior
6060
----------------
6161

62-
When installing from source, a `git` checkout or `pip`:
62+
When installing from source, a :program:`git` checkout or pip_:
6363

64-
- `setup.py` attempts to `import numpy`. If this fails, the
64+
- :file:`setup.py` attempts to ``import numpy``. If this fails, the
6565
installation fails.
6666

67-
- For each of `dateutil`, `pytz` and `six`, `setup.py` attempts to
67+
- For each of dateutil_, pytz_ and six_, `setup.py` attempts to
6868
import them (from the top-level namespace). If that fails,
6969
matplotlib installs its local copy of the library into the
7070
top-level namespace.
7171

72-
- `pyparsing` is always installed inside of the matplotlib
72+
- pyparsing_ is always installed inside of the matplotlib
7373
namespace.
7474

75-
This behavior is most surprising when used with `pip`, because no
76-
`pip` dependency resolution is performed, even though it is likely to
75+
This behavior is most surprising when used with pip_, because no
76+
pip_ dependency resolution is performed, even though it is likely to
7777
work for all of these packages.
7878

79-
The fact that `pyparsing` is installed in the matplotlib namespace has
79+
The fact that pyparsing_ is installed in the matplotlib namespace has
8080
reportedly (#1290) confused some users into thinking it is a
8181
matplotlib-related module and import it from there rather than the
8282
top-level.
8383

84-
When installing using the Windows installer, `dateutil`, `pytz` and
85-
`six` are installed at the top-level *always*, potentially overwriting
84+
When installing using the Windows installer, dateutil_, pytz_ and
85+
six_ are installed at the top-level *always*, potentially overwriting
8686
already installed copies of those libraries.
8787

8888
TODO: Describe behavior with the OS-X installer.
8989

9090
When installing using a package manager (Debian, RedHat, MacPorts
9191
etc.), this behavior actually does the right thing, and there are no
9292
special patches in the matplotlib packages to deal with the fact that
93-
we handle `dateutil`, `pytz` and `six` in this way. However, care
93+
we handle dateutil_, pytz_ and six_ in this way. However, care
9494
should be taken that whatever approach we move to continues to work in
9595
that context.
9696

@@ -104,9 +104,9 @@ Desired behavior
104104
----------------
105105

106106
Third-party dependencies are downloaded and installed from their
107-
canonical locations by leveraging `pip`, `distribute` and `PyPI`.
107+
canonical locations by leveraging pip_, distribute_ and PyPI_.
108108

109-
`dateutil`, `pytz`, and `pyparsing` should be made into optional
109+
dateutil_, pytz_, and pyparsing_ should be made into optional
110110
dependencies -- though obviously some features would fail if they
111111
aren't installed. This will allow the user to decide whether they
112112
want to bother installing a particular feature.
@@ -116,31 +116,31 @@ Implementation
116116

117117
For installing from source, and assuming the user has all of the
118118
C-level compilers and dependencies, this can be accomplished fairly
119-
easily using `distribute` and following the instructions `here
119+
easily using distribute_ and following the instructions `here
120120
<https://pypi.python.org/pypi/distribute>`_. The only anticipated
121-
change to the matplotlib library code will be to import `pyparsing`
121+
change to the matplotlib library code will be to import pyparsing_
122122
from the top-level namespace rather than from within matplotlib. Note
123-
that `distribute` will also allow us to remove the direct dependency
124-
on `six`, since it is, strictly speaking, only a direct dependency of
125-
`dateutil`.
123+
that distribute_ will also allow us to remove the direct dependency
124+
on six_, since it is, strictly speaking, only a direct dependency of
125+
dateutil_.
126126

127127
For binary installations, there are a number of alternatives (here
128128
ordered from best/hardest to worst/easiest):
129129

130130
1. The distutils wininst installer allows a post-install script to
131-
run. It might be possible to get this script to run `pip` to
131+
run. It might be possible to get this script to run pip_ to
132132
install the other dependencies. (See `this thread
133133
<http://grokbase.com/t/python/distutils-sig/109bdnfhp4/distutils-ann-setuptools-post-install-script-for-bdist-wininst>`_
134134
for someone who has trod that ground before).
135135

136-
2. Continue to ship `dateutil`, `pytz`, `six` and `pyparsing` in
136+
2. Continue to ship dateutil_, pytz_, six_ and pyparsing_ in
137137
our installer, but use the post-install-script to install them
138138
*only* if they can not already be found.
139139

140140
3. Move all of these packages inside a (new) `matplotlib.extern`
141141
namespace so it is clear for outside users that these are
142142
external packages. Add some conditional imports in the core
143-
matplotlib codebase so `dateutil` (at the top-level) is tried
143+
matplotlib codebase so dateutil_ (at the top-level) is tried
144144
first, and failing that `matplotlib.extern.dateutil` is used.
145145

146146
2 and 3 are undesirable as they still require maintaining copies of
@@ -164,7 +164,17 @@ accessing the network).
164164
Alternatives
165165
============
166166

167-
Distributing binary `eggs` doesn't feel like a usable solution. That
168-
requires getting `easy_install` installed first, and Windows users
169-
generally prefer the well known `.exe` or `.msi` installer that works
167+
Distributing binary eggs doesn't feel like a usable solution. That
168+
requires getting easy_install_ installed first, and Windows users
169+
generally prefer the well known ``.exe`` or ``.msi`` installer that works
170170
out of the box.
171+
172+
.. _PyPI: https://pypi.org
173+
.. _dateutil: https://pypi.org/project/python-dateutil/
174+
.. _distribute: https://pypi.org/project/distribute/
175+
.. _pip: https://pypi.org/project/pip/
176+
.. _pyparsing: https://pypi.org/project/pyparsing/
177+
.. _pytz: https://pypi.org/project/pytz/
178+
.. _setuptools: https://pypi.org/project/setuptools/
179+
.. _six: https://pypi.org/project/six/
180+
.. _easy_install: https://setuptools.readthedocs.io/en/latest/easy_install.html

doc/devel/MEP/MEP12.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Branches and Pull requests
1818

1919
#1623, #1924, #2181
2020

21-
PR `#2474 <https://github.com/matplotlib/matplotlib/pull/2474`>_
21+
PR `#2474 <https://github.com/matplotlib/matplotlib/pull/2474>`_
2222
demonstrates a single example being cleaned up and moved to the
2323
appropriate section.
2424

doc/devel/MEP/MEP23.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ the `Toolbar` makes it pretty hard to switch between canvases.
5151
Implementation
5252
==============
5353

54-
The first implementation will be done in `GTK3` using a Notebook as
54+
The first implementation will be done in GTK3 using a Notebook as
5555
canvas container.
5656

5757
`FigureManagerBase`

doc/devel/MEP/MEP26.rst

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ Detailed description
3434
====================
3535

3636
Currently, the look and appearance of existing artist objects (figure,
37-
axes, Line2D etc...) can only be updated via `set_` and `get_` methods
37+
axes, Line2D etc...) can only be updated via ``set_`` and ``get_`` methods
3838
on the artist object, which is quite laborious, especially if no
3939
reference to the artist(s) has been stored. The new style sheets
4040
introduced in 1.4 allow styling before a plot is created, but do not
4141
offer any means to dynamically update plots or distinguish between
42-
artists of the same type (i.e. to specify the `line color` and `line
43-
style` separately for differing `Line2D` objects).
42+
artists of the same type (i.e. to specify the ``line color`` and ``line
43+
style`` separately for differing `.Line2D` objects).
4444

4545
The initial development should concentrate on allowing styling of
46-
artist primitives (those `artists` that do not contain other
47-
`artists`), and further development could expand the CSS syntax rules
46+
artist primitives (those `.Artist`\s that do not contain other
47+
`.Artist`\s), and further development could expand the CSS syntax rules
4848
and parser to allow more complex styling. See the appendix for a list
4949
of primitives.
5050

@@ -67,10 +67,10 @@ Implementation
6767

6868
It will be easiest to allow a '3rd party' to modify/set the style of
6969
an artist if the 'style' is created as a separate class and store
70-
against the artist as a property. The `GraphicsContext` class already
70+
against the artist as a property. The `.GraphicsContext` class already
7171
provides a the basis of a `Style` class and an artists `draw` method can
7272
be refactored to use the `Style` class rather than setting up it's own
73-
`GraphicsContext` and transferring it's style-related properties to
73+
`.GraphicsContext` and transferring it's style-related properties to
7474
it. A minimal example of how this could be implemented is shown here:
7575
https://github.com/JamesRamm/mpl_experiment
7676

@@ -103,7 +103,7 @@ the syntax is given below and then explained ::
103103

104104
propValue ::= Ident | Number | Colour | "None"
105105

106-
`ArtistIdent`, `Ident`, `Number` and `Colour` are tokens (the basic
106+
``ArtistIdent``, ``Ident``, ``Number`` and ``Colour`` are tokens (the basic
107107
building blocks of the expression) which are defined by regular
108108
expressions.
109109

@@ -116,14 +116,14 @@ syntax ::
116116

117117
selector {attribute: value;}
118118

119-
Each rule can have any number of `attribute`: `value` pairs, and a
119+
Each rule can have any number of ``attribute: value`` pairs, and a
120120
stylesheet can have any number of rules.
121121

122-
The initial syntax is designed only for `artist` primitives. It does
123-
not address the question of how to set properties on `container` types
124-
(whose properties may themselves be `artists` with settable
122+
The initial syntax is designed only for `.Artist` primitives. It does
123+
not address the question of how to set properties on `.Container` types
124+
(whose properties may themselves be `.Artist`\s with settable
125125
properties), however, a future solution to this could simply be nested
126-
`RuleSet` s
126+
``RuleSet``\s
127127

128128
Selectors
129129
~~~~~~~~~
@@ -138,22 +138,22 @@ initial development:
138138
Artist Type Selector
139139

140140

141-
Select an `artist` by it's type. E.g `Line2D` or `Text`::
141+
Select an `.Artist` by it's type. E.g `.Line2D` or `.Text`::
142142

143143
Line2D {attribute: value}
144144

145-
The regex for matching the artist type selector (`ArtistIdent` in the BNF grammar) would be::
145+
The regex for matching the artist type selector (``ArtistIdent`` in the BNF grammar) would be::
146146

147147
ArtistIdent = r'(?P<ArtistIdent>\bLine2D\b|\bText\b|\bAxesImage\b|\bFigureImage\b|\bPatch\b)'
148148

149149
GID selector
150150
~~~~~~~~~~~~
151151

152-
Select an `artist` by its `gid`::
152+
Select an `.Artist` by its ``gid``::
153153

154154
Line2D#myGID {attribute: value}
155155

156-
A `gid` can be any string, so the regex could be as follows::
156+
A ``gid`` can be any string, so the regex could be as follows::
157157

158158
Ident = r'(?P<Ident>[a-zA-Z_][a-zA-Z_0-9]*)'
159159

@@ -164,15 +164,15 @@ The above selectors roughly correspond to their CSS counterparts
164164
Attributes and values
165165
~~~~~~~~~~~~~~~~~~~~~
166166

167-
- `Attributes` are any valid (settable) property for the `artist` in question.
168-
- `Values` are any valid value for the property (Usually a string, or number).
167+
- ``Attributes`` are any valid (settable) property for the `.Artist` in question.
168+
- ``Values`` are any valid value for the property (Usually a string, or number).
169169

170170
Parsing
171171
-------
172172

173173
Parsing would consist of breaking the stylesheet into tokens (the
174174
python cookbook gives a nice tokenizing recipe on page 66), applying
175-
the syntax rules and constructing a `Tree`. This requires defining the
175+
the syntax rules and constructing a ``Tree``. This requires defining the
176176
grammar of the stylesheet (again, we can borrow from CSS) and writing
177177
a parser. Happily, there is a recipe for this in the python cookbook
178178
aswell.
@@ -184,7 +184,7 @@ Visitor pattern for matplotlib figure
184184
In order to apply the stylesheet rules to the relevant artists, we
185185
need to 'visit' each artist in a figure and apply the relevant rule.
186186
Here is a visitor class (again, thanks to python cookbook), where each
187-
`node` would be an artist in the figure. A `visit_` method would need
187+
``node`` would be an artist in the figure. A ``visit_`` method would need
188188
to be implemented for each mpl artist, to handle the different
189189
properties for each ::
190190

@@ -196,18 +196,18 @@ properties for each ::
196196
raise NotImplementedError
197197
return meth(node)
198198

199-
An `evaluator` class would then take the stylesheet rules and
199+
An ``evaluator`` class would then take the stylesheet rules and
200200
implement the visitor on each one of them.
201201

202202

203203

204204
Backward compatibility
205205
======================
206206

207-
Implementing a separate `Style` class would break backward
207+
Implementing a separate ``Style`` class would break backward
208208
compatibility as many get/set methods on an artist would become
209209
redundant. While it would be possible to alter these methods to hook
210-
into the `Style` class (stored as a property against the artist), I
210+
into the ``Style`` class (stored as a property against the artist), I
211211
would be in favor of simply removing them to both neaten/simplify the
212212
codebase and to provide a simple, uncluttered API...
213213

doc/devel/documenting_mpl.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ Referring to other documents and sections
158158

159159
Sphinx_ allows internal references_ between documents.
160160

161-
Documents can be linked with the `:doc:` directive:
161+
Documents can be linked with the ``:doc:`` directive:
162162

163163
.. code-block:: rst
164164
@@ -640,7 +640,7 @@ If a subclass overrides a method but does not change the semantics, we can
640640
reuse the parent docstring for the method of the child class. Python does this
641641
automatically, if the subclass method does not have a docstring.
642642

643-
Use a plain comment `# docstring inherited` to denote the intention to reuse
643+
Use a plain comment ``# docstring inherited`` to denote the intention to reuse
644644
the parent docstring. That way we do not accidentally create a docstring in
645645
the future::
646646

@@ -661,8 +661,8 @@ Adding figures
661661
--------------
662662

663663
As above (see :ref:`rst-figures-and-includes`), figures in the examples gallery
664-
can be referenced with a `:plot:` directive pointing to the python script that
665-
created the figure. For instance the `~.Axes.legend` docstring references
664+
can be referenced with a ``:plot:`` directive pointing to the python script
665+
that created the figure. For instance the `~.Axes.legend` docstring references
666666
the file :file:`examples/text_labels_and_annotations/legend.py`:
667667

668668
.. code-block:: python
@@ -751,7 +751,7 @@ Tutorials are made with the exact same mechanism, except they are longer, and
751751
typically have more than one comment block (i.e.
752752
:doc:`/tutorials/introductory/usage`). The first comment block
753753
can be the same as the example above. Subsequent blocks of ReST text
754-
are delimited by a line of `###` characters:
754+
are delimited by a line of ``###`` characters:
755755

756756
.. code-block:: python
757757

0 commit comments

Comments
 (0)