Commit adc0274
committed
Include alternatives to deprecations in the documentation
- add `alternative` and `addendum` to the documentation by including
them in the second argument of the `.. deprecated::` directive
- allow for backticks and optional reference to create links to the
mentioned alternatives in the documentation
- remove these additional links and backticks in the deprecation
warning message that is emitted when using a deprecated item
Example:
@_api.deprecated("3.5", alternative="`num2date(e).timestamp()<.num2date>`"
will create the directive
.. deprecated:: 3.5
Use `num2date(e).timestamp()<.num2date>` instead.
which creates a link to matplotlib.dates.num2date with the caption
num2date(e).timestamp(). The deprecation warning message will read
"... Use num2date(e).timestamp() instead."1 parent 68d6b79 commit adc0274
File tree
3 files changed
+24
-1
lines changed- doc/devel
- lib/matplotlib
- _api
- tests
3 files changed
+24
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
329 | 333 | | |
330 | 334 | | |
331 | 335 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
50 | 55 | | |
51 | 56 | | |
52 | 57 | | |
| |||
207 | 212 | | |
208 | 213 | | |
209 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
210 | 218 | | |
211 | 219 | | |
212 | 220 | | |
213 | | - | |
| 221 | + | |
214 | 222 | | |
215 | 223 | | |
216 | 224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
0 commit comments