File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed
Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change 167167# sphinx-notfound-page
168168notfound_urls_prefix = "/"
169169
170+ # Dynamically expose the Python version associated with the "main" branch.
171+ # The release cycle data may not be ordered, so choose the numerically highest
172+ # version key instead of relying on a specific entry's position.
173+ with open ("include/release-cycle.json" , encoding = "UTF-8" ) as _f :
174+ _cycle = json .load (_f )
175+ _main_version = max (
176+ _cycle ,
177+ key = lambda v : tuple (int (part ) for part in v .split ("." )),
178+ )
179+
170180# prolog and epilogs
171- rst_prolog = """
181+ rst_prolog = f """
172182.. |draft| replace::
173183 This is part of a **Draft** of the Python Contributor's Guide.
174184 Text in square brackets are notes about content to fill in.
185195
186196.. _Refactoring the DevGuide: https://discuss.python.org/t/refactoring-the-devguide-into-a-contribution-guide/63409
187197
188- """
198+ .. |mainversion| replace:: { _main_version }
189199
190- # Dynamically expose the Python version associated with the "main" branch.
191- # The release cycle data may not be ordered, so choose the numerically highest
192- # version key instead of relying on a specific entry's position.
193- with open ("include/release-cycle.json" , encoding = "UTF-8" ) as _f :
194- _cycle = json .load (_f )
195- _main_version = max (
196- _cycle ,
197- key = lambda v : tuple (int (part ) for part in v .split ("." )),
198- )
199- rst_prolog += f"\n .. |mainversion| replace:: { _main_version } \n "
200+ """
200201
201202# sphinx.ext.extlinks
202203# This config is a dictionary of external sites,
You can’t perform that action at this time.
0 commit comments