|
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 |
|
|
49 | 51 |
|
50 | 52 | # General substitutions.
|
51 | 53 | project = 'Python'
|
52 |
| -copyright = '2001-%s, Python Software Foundation' % time.strftime('%Y') |
| 54 | +copyright = f"2001-{time.strftime('%Y')}, Python Software Foundation" |
53 | 55 |
|
54 | 56 | # We look for the Include/patchlevel.h file in the current Python source tree
|
55 | 57 | # and replace the values accordingly.
|
|
291 | 293 | 'root_include_title': False # We use the version switcher instead.
|
292 | 294 | }
|
293 | 295 |
|
| 296 | +if os.getenv("READTHEDOCS"): |
| 297 | + html_theme_options["hosted_on"] = '<a href="https://about.readthedocs.com/">Read the Docs</a>' |
| 298 | + |
294 | 299 | # Override stylesheet fingerprinting for Windows CHM htmlhelp to fix GH-91207
|
295 | 300 | # https://github.com/python/cpython/issues/91207
|
296 | 301 | if any('htmlhelp' in arg for arg in sys.argv):
|
|
299 | 304 | print("It may be removed in the future\n")
|
300 | 305 |
|
301 | 306 | # Short title used e.g. for <title> HTML tags.
|
302 |
| -html_short_title = '%s Documentation' % release |
| 307 | +html_short_title = f'{release} Documentation' |
303 | 308 |
|
304 | 309 | # Deployment preview information
|
305 | 310 | # (See .readthedocs.yml and https://docs.readthedocs.io/en/stable/reference/environment-variables.html)
|
|
348 | 353 |
|
349 | 354 | latex_engine = 'xelatex'
|
350 | 355 |
|
351 |
| -# Get LaTeX to handle Unicode correctly |
352 | 356 | latex_elements = {
|
353 |
| -} |
354 |
| - |
355 |
| -# Additional stuff for the LaTeX preamble. |
356 |
| -latex_elements['preamble'] = r''' |
| 357 | + # For the LaTeX preamble. |
| 358 | + 'preamble': r''' |
357 | 359 | \authoraddress{
|
358 | 360 | \sphinxstrong{Python Software Foundation}\\
|
359 | 361 | Email: \sphinxemail{[email protected]}
|
360 | 362 | }
|
361 | 363 | \let\Verbatim=\OriginalVerbatim
|
362 | 364 | \let\endVerbatim=\endOriginalVerbatim
|
363 | 365 | \setcounter{tocdepth}{2}
|
364 |
| -''' |
365 |
| - |
366 |
| -# The paper size ('letter' or 'a4'). |
367 |
| -latex_elements['papersize'] = 'a4' |
368 |
| - |
369 |
| -# The font size ('10pt', '11pt' or '12pt'). |
370 |
| -latex_elements['pointsize'] = '10pt' |
| 366 | +''', |
| 367 | + # The paper size ('letter' or 'a4'). |
| 368 | + 'papersize': 'a4', |
| 369 | + # The font size ('10pt', '11pt' or '12pt'). |
| 370 | + 'pointsize': '10pt', |
| 371 | +} |
371 | 372 |
|
372 | 373 | # Grouping the document tree into LaTeX files. List of tuples
|
373 | 374 | # (source start file, target name, title, author, document class [howto/manual]).
|
|
431 | 432 |
|
432 | 433 | # Regexes to find C items in the source files.
|
433 | 434 | coverage_c_regexes = {
|
434 |
| - 'cfunction': (r'^PyAPI_FUNC\(.*\)\s+([^_][\w_]+)'), |
435 |
| - 'data': (r'^PyAPI_DATA\(.*\)\s+([^_][\w_]+)'), |
436 |
| - 'macro': (r'^#define ([^_][\w_]+)\(.*\)[\s|\\]'), |
| 435 | + 'cfunction': r'^PyAPI_FUNC\(.*\)\s+([^_][\w_]+)', |
| 436 | + 'data': r'^PyAPI_DATA\(.*\)\s+([^_][\w_]+)', |
| 437 | + 'macro': r'^#define ([^_][\w_]+)\(.*\)[\s|\\]', |
437 | 438 | }
|
438 | 439 |
|
439 | 440 | # The coverage checker will ignore all C items whose names match these regexes
|
|
0 commit comments