|
6 | 6 | # The contents of this file are pickled, so don't put values in the namespace
|
7 | 7 | # that aren't pickleable (module imports are okay, they're removed automatically).
|
8 | 8 |
|
9 |
| -import sys, os, time |
| 9 | +import os |
| 10 | +import sys |
| 11 | +import time |
10 | 12 | sys.path.append(os.path.abspath('tools/extensions'))
|
11 | 13 | sys.path.append(os.path.abspath('includes'))
|
12 | 14 |
|
|
55 | 57 |
|
56 | 58 | # General substitutions.
|
57 | 59 | project = 'Python'
|
58 |
| -copyright = '2001-%s, Python Software Foundation' % time.strftime('%Y') |
| 60 | +copyright = f"2001-{time.strftime('%Y')}, Python Software Foundation" |
59 | 61 |
|
60 | 62 | # We look for the Include/patchlevel.h file in the current Python source tree
|
61 | 63 | # and replace the values accordingly.
|
|
302 | 304 | 'root_include_title': False # We use the version switcher instead.
|
303 | 305 | }
|
304 | 306 |
|
| 307 | +if os.getenv("READTHEDOCS"): |
| 308 | + html_theme_options["hosted_on"] = '<a href="https://about.readthedocs.com/">Read the Docs</a>' |
| 309 | + |
305 | 310 | # Override stylesheet fingerprinting for Windows CHM htmlhelp to fix GH-91207
|
306 | 311 | # https://github.com/python/cpython/issues/91207
|
307 | 312 | if any('htmlhelp' in arg for arg in sys.argv):
|
|
310 | 315 | print("It may be removed in the future\n")
|
311 | 316 |
|
312 | 317 | # Short title used e.g. for <title> HTML tags.
|
313 |
| -html_short_title = '%s Documentation' % release |
| 318 | +html_short_title = f'{release} Documentation' |
314 | 319 |
|
315 | 320 | # Deployment preview information
|
316 | 321 | # (See .readthedocs.yml and https://docs.readthedocs.io/en/stable/reference/environment-variables.html)
|
|
359 | 364 |
|
360 | 365 | latex_engine = 'xelatex'
|
361 | 366 |
|
362 |
| -# Get LaTeX to handle Unicode correctly |
363 | 367 | latex_elements = {
|
364 |
| -} |
365 |
| - |
366 |
| -# Additional stuff for the LaTeX preamble. |
367 |
| -latex_elements['preamble'] = r''' |
| 368 | + # For the LaTeX preamble. |
| 369 | + 'preamble': r''' |
368 | 370 | \authoraddress{
|
369 | 371 | \sphinxstrong{Python Software Foundation}\\
|
370 | 372 | Email: \sphinxemail{docs@python.org}
|
371 | 373 | }
|
372 | 374 | \let\Verbatim=\OriginalVerbatim
|
373 | 375 | \let\endVerbatim=\endOriginalVerbatim
|
374 | 376 | \setcounter{tocdepth}{2}
|
375 |
| -''' |
376 |
| - |
377 |
| -# The paper size ('letter' or 'a4'). |
378 |
| -latex_elements['papersize'] = 'a4' |
379 |
| - |
380 |
| -# The font size ('10pt', '11pt' or '12pt'). |
381 |
| -latex_elements['pointsize'] = '10pt' |
| 377 | +''', |
| 378 | + # The paper size ('letter' or 'a4'). |
| 379 | + 'papersize': 'a4', |
| 380 | + # The font size ('10pt', '11pt' or '12pt'). |
| 381 | + 'pointsize': '10pt', |
| 382 | +} |
382 | 383 |
|
383 | 384 | # Grouping the document tree into LaTeX files. List of tuples
|
384 | 385 | # (source start file, target name, title, author, document class [howto/manual]).
|
|
441 | 442 |
|
442 | 443 | # Regexes to find C items in the source files.
|
443 | 444 | coverage_c_regexes = {
|
444 |
| - 'cfunction': (r'^PyAPI_FUNC\(.*\)\s+([^_][\w_]+)'), |
445 |
| - 'data': (r'^PyAPI_DATA\(.*\)\s+([^_][\w_]+)'), |
446 |
| - 'macro': (r'^#define ([^_][\w_]+)\(.*\)[\s|\\]'), |
| 445 | + 'cfunction': r'^PyAPI_FUNC\(.*\)\s+([^_][\w_]+)', |
| 446 | + 'data': r'^PyAPI_DATA\(.*\)\s+([^_][\w_]+)', |
| 447 | + 'macro': r'^#define ([^_][\w_]+)\(.*\)[\s|\\]', |
447 | 448 | }
|
448 | 449 |
|
449 | 450 | # The coverage checker will ignore all C items whose names match these regexes
|
|
0 commit comments