|
| 1 | +import json |
| 2 | + |
1 | 3 | extensions = [ |
2 | 4 | 'notfound.extension', |
3 | 5 | 'sphinx.ext.extlinks', |
|
84 | 86 | r'\/.*', |
85 | 87 | ] |
86 | 88 |
|
87 | | -# Check the link itself, but ignore anchors that are added by JS |
88 | | -# https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-linkcheck_anchors_ignore_for_url |
89 | | -linkcheck_anchors_ignore_for_url = [ |
90 | | - # GitHub |
91 | | - r'https://github.com/.*', |
92 | | -] |
93 | | - |
94 | 89 | linkcheck_ignore = [ |
95 | | - # The voters repo is private and appears as a 404 |
96 | | - 'https://github.com/python/voters', |
97 | | - # The python-core team link is private, redirects to login |
98 | | - 'https://github.com/orgs/python/teams/python-core', |
| 90 | + # Checks fail due to rate limits |
| 91 | + r'https://github.com/.*', |
| 92 | + r'https://www.gnu.org/software/autoconf/', |
99 | 93 | # The Discourse groups are private unless you are logged in |
100 | 94 | 'https://discuss.python.org/groups/staff', |
101 | 95 | 'https://discuss.python.org/groups/moderators', |
|
117 | 111 | # Advanced Tools was renamed Development Tools in gh-1149 |
118 | 112 | "advanced-tools/clang.rst": "development-tools/clang.rst", |
119 | 113 | "advanced-tools/gdb.rst": "development-tools/gdb.rst", |
120 | | - # Core Developers |
121 | | - "coredev.rst": "core-developers/become-core-developer.rst", |
122 | | - "committing.rst": "core-developers/committing.rst", |
123 | | - "developers.rst": "core-developers/developer-log.rst", |
124 | | - "experts.rst": "core-developers/experts.rst", |
125 | | - "motivations.rst": "core-developers/motivations.rst", |
| 114 | + # Core team |
| 115 | + "coredev.rst": "core-team/join-team.rst", |
| 116 | + "committing.rst": "core-team/committing.rst", |
| 117 | + "developers.rst": "core-team/team-log.rst", |
| 118 | + "experts.rst": "core-team/experts.rst", |
| 119 | + "motivations.rst": "core-team/motivations.rst", |
| 120 | + # core-developers/ -> core-team/ |
| 121 | + "core-developers/become-core-developer.rst": "core-team/join-team.rst", |
| 122 | + "core-developers/committing.rst": "core-team/committing.rst", |
| 123 | + "core-developers/developer-log.rst": "core-team/team-log.rst", |
| 124 | + "core-developers/experts.rst": "core-team/experts.rst", |
| 125 | + "core-developers/index.rst": "core-team/index.rst", |
| 126 | + "core-developers/memorialization.rst": "core-team/memorialization.rst", |
| 127 | + "core-developers/motivations.rst": "core-team/motivations.rst", |
| 128 | + "core-developers/responsibilities.rst": "core-team/responsibilities.rst", |
126 | 129 | # Developer Workflow |
127 | 130 | "c-api.rst": "developer-workflow/c-api.rst", |
128 | 131 | "communication.rst": "developer-workflow/communication-channels.rst", |
|
135 | 138 | # Documentation |
136 | 139 | "docquality.rst": "documentation/help-documenting.rst", |
137 | 140 | "documenting.rst": "documentation/start-documenting.rst", |
| 141 | + # Translating |
| 142 | + "documentation/translating.rst": "documentation/translations/translating.rst", |
| 143 | + "translating.rst": "documentation/translations/translating.rst", |
| 144 | + "coordinating.rst": "documentation/translations/coordinating.rst", |
138 | 145 | # Getting Started |
139 | 146 | "fixingissues.rst": "getting-started/fixing-issues.rst", |
140 | 147 | "help.rst": "getting-started/getting-help.rst", |
|
169 | 176 | # sphinx-notfound-page |
170 | 177 | notfound_urls_prefix = "/" |
171 | 178 |
|
| 179 | +# Dynamically expose the Python version associated with the "main" branch. |
| 180 | +# Exactly one entry in ``release-cycle.json`` should have ``"branch": "main"``. |
| 181 | +with open("include/release-cycle.json", encoding="UTF-8") as _f: |
| 182 | + _cycle = json.load(_f) |
| 183 | + |
| 184 | +_main_version = next( |
| 185 | + version for version, data in _cycle.items() if data.get("branch") == "main" |
| 186 | +) |
| 187 | + |
172 | 188 | # prolog and epilogs |
173 | | -rst_prolog = """ |
| 189 | +rst_prolog = f""" |
174 | 190 | .. |draft| replace:: |
175 | 191 | This is part of a **Draft** of the Python Contributor's Guide. |
176 | 192 | Text in square brackets are notes about content to fill in. |
|
187 | 203 |
|
188 | 204 | .. _Refactoring the DevGuide: https://discuss.python.org/t/refactoring-the-devguide-into-a-contribution-guide/63409 |
189 | 205 |
|
| 206 | +.. |main_version| replace:: {_main_version} |
| 207 | +
|
190 | 208 | """ |
191 | 209 |
|
192 | 210 | # sphinx.ext.extlinks |
|
0 commit comments