Commit 4fcfcfa
committed
Add :pypi: extlinks alias and convert inline PyPI URLs
Closes #1370.
Adds a ``pypi`` entry to the ``extlinks`` dict in source/conf.py so RST
files can use ``:pypi:`name``` instead of hard-coded
``pypi.org/project/name`` URLs. The role renders the project name as
link text and points at ``https://pypi.org/project/<name>/``.
Converts ten existing inline links where the visible text already
matched the project name, so rendered output is preserved:
- discussions/deploying-python-applications.rst: Pynsist, py2exe,
py2app, pex
- overview.rst: lxml, numpy, Pillow, pynsist
- key_projects.rst: cmake (scikit-build), ninja, cmake (scikit-build-core)
Deliberately left alone for this PR:
- Named reference targets (``.. _name: URL``) — converting requires
edits at every reuse site; can be done as a follow-up if wanted.
- Inline links whose visible text differs from the project name
(e.g. ``PyPI <…/bandersnatch>`` in key_projects.rst, ``PIL distribution``
in overview.rst) — converting would change the rendered prose.
- ``six`` and ``modernize`` in supporting-multiple-python-versions.rst —
both are also reused later as ``six_`` / ``modernize_`` named
references, so the inline form cannot be replaced in isolation.
- Version-pinned or anchor-bearing URLs
(e.g. ``pypi.org/project/pip/23.3.1/#files``).
- Template / example URLs that are not project links
(``pypi.org/project/<sampleproject>``, ``test.pypi.org/...``,
``docs.pypi.org/...``).
The docs build cleanly with ``sphinx-build -W --keep-going``.1 parent c31a69a commit 4fcfcfa
4 files changed
Lines changed: 14 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
202 | 203 | | |
203 | 204 | | |
204 | 205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
757 | 757 | | |
758 | 758 | | |
759 | 759 | | |
760 | | - | |
| 760 | + | |
761 | 761 | | |
762 | 762 | | |
763 | | - | |
764 | | - | |
| 763 | + | |
| 764 | + | |
765 | 765 | | |
766 | 766 | | |
767 | 767 | | |
| |||
773 | 773 | | |
774 | 774 | | |
775 | 775 | | |
776 | | - | |
777 | | - | |
| 776 | + | |
| 777 | + | |
778 | 778 | | |
779 | 779 | | |
780 | 780 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
| 99 | + | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | | - | |
| 311 | + | |
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| |||
0 commit comments