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