1# 2# Python documentation build configuration file 3# 4# This file is execfile()d with the current directory set to its containing dir. 5# 6# The contents of this file are pickled, so don't put values in the namespace 7# that aren't pickleable (module imports are okay, they're removed automatically). 8 9import importlib 10import os 11import sys 12import time 13 14import sphinx 15 16# Make our custom extensions available to Sphinx 17sys.path.append(os.path.abspath('tools/extensions')) 18sys.path.append(os.path.abspath('includes')) 19 20# Python specific content from Doc/Tools/extensions/pyspecific.py 21from pyspecific import SOURCE_URI 22 23# General configuration 24# --------------------- 25 26# Our custom Sphinx extensions are found in Doc/Tools/extensions/ 27extensions = [ 28 'audit_events', 29 'availability', 30 'c_annotations', 31 'glossary_search', 32 'lexers', 33 'pyspecific', 34 'sphinx.ext.coverage', 35 'sphinx.ext.doctest', 36 'sphinx.ext.extlinks', 37] 38 39# Skip if downstream redistributors haven't installed them 40try: 41 import notfound.extension # noqa: F401 42except ImportError: 43 pass 44else: 45 extensions.append('notfound.extension') 46try: 47 import sphinxext.opengraph # noqa: F401 48except ImportError: 49 pass 50else: 51 extensions.append('sphinxext.opengraph') 52 53 54doctest_global_setup = ''' 55try: 56 import _tkinter 57except ImportError: 58 _tkinter = None 59# Treat warnings as errors, done here to prevent warnings in Sphinx code from 60# causing spurious CPython test failures. 61import warnings 62warnings.simplefilter('error') 63del warnings 64''' 65 66manpages_url = 'https://manpages.debian.org/{path}' 67 68# General substitutions. 69project = 'Python' 70if sphinx.version_info[:2] >= (8, 1): 71 copyright = "2001-%Y, Python Software Foundation" 72else: 73 copyright = f"2001-{time.strftime('%Y')}, Python Software Foundation" 74 75# We look for the Include/patchlevel.h file in the current Python source tree 76# and replace the values accordingly. 77# See Doc/tools/extensions/patchlevel.py 78version, release = importlib.import_module('patchlevel').get_version_info() 79 80rst_epilog = f""" 81.. |python_version_literal| replace:: ``Python {version}`` 82.. |python_x_dot_y_literal| replace:: ``python{version}`` 83.. |usr_local_bin_python_x_dot_y_literal| replace:: ``/usr/local/bin/python{version}`` 84""" 85 86# There are two options for replacing |today|. Either, you set today to some 87# non-false value and use it. 88today = '' 89# Or else, today_fmt is used as the format for a strftime call. 90today_fmt = '%B %d, %Y' 91 92# By default, highlight as Python 3. 93highlight_language = 'python3' 94 95# Minimum version of sphinx required 96needs_sphinx = '7.2.6' 97 98# Create table of contents entries for domain objects (e.g. functions, classes, 99# attributes, etc.). Default is True. 100toc_object_entries = True 101# Hide parents to tidy up long entries in sidebar 102toc_object_entries_show_parents = 'hide' 103 104# Ignore any .rst files in the includes/ directory; 105# they're embedded in pages but not rendered as individual pages. 106# Ignore any .rst files in the venv/ directory. 107exclude_patterns = ['includes/*.rst', 'venv/*', 'README.rst'] 108venvdir = os.getenv('VENVDIR') 109if venvdir is not None: 110 exclude_patterns.append(venvdir + '/*') 111 112nitpick_ignore = [ 113 # Standard C functions 114 ('c:func', 'calloc'), 115 ('c:func', 'ctime'), 116 ('c:func', 'dlopen'), 117 ('c:func', 'exec'), 118 ('c:func', 'fcntl'), 119 ('c:func', 'flock'), 120 ('c:func', 'fork'), 121 ('c:func', 'free'), 122 ('c:func', 'gettimeofday'), 123 ('c:func', 'gmtime'), 124 ('c:func', 'grantpt'), 125 ('c:func', 'ioctl'), 126 ('c:func', 'localeconv'), 127 ('c:func', 'localtime'), 128 ('c:func', 'main'), 129 ('c:func', 'malloc'), 130 ('c:func', 'mktime'), 131 ('c:func', 'posix_openpt'), 132 ('c:func', 'printf'), 133 ('c:func', 'ptsname'), 134 ('c:func', 'ptsname_r'), 135 ('c:func', 'realloc'), 136 ('c:func', 'snprintf'), 137 ('c:func', 'sprintf'), 138 ('c:func', 'stat'), 139 ('c:func', 'strftime'), 140 ('c:func', 'system'), 141 ('c:func', 'time'), 142 ('c:func', 'unlockpt'), 143 ('c:func', 'vsnprintf'), 144 # Standard C types 145 ('c:type', 'FILE'), 146 ('c:type', 'int8_t'), 147 ('c:type', 'int16_t'), 148 ('c:type', 'int32_t'), 149 ('c:type', 'int64_t'), 150 ('c:type', 'intmax_t'), 151 ('c:type', 'off_t'), 152 ('c:type', 'ptrdiff_t'), 153 ('c:type', 'siginfo_t'), 154 ('c:type', 'size_t'), 155 ('c:type', 'ssize_t'), 156 ('c:type', 'time_t'), 157 ('c:type', 'uint8_t'), 158 ('c:type', 'uint16_t'), 159 ('c:type', 'uint32_t'), 160 ('c:type', 'uint64_t'), 161 ('c:type', 'uintmax_t'), 162 ('c:type', 'uintptr_t'), 163 ('c:type', 'va_list'), 164 ('c:type', 'wchar_t'), 165 ('c:type', '__int64'), 166 ('c:type', 'unsigned __int64'), 167 ('c:type', 'double'), 168 # Standard C structures 169 ('c:struct', 'in6_addr'), 170 ('c:struct', 'in_addr'), 171 ('c:struct', 'stat'), 172 ('c:struct', 'statvfs'), 173 ('c:struct', 'timeval'), 174 ('c:struct', 'timespec'), 175 # Standard C macros 176 ('c:macro', 'LLONG_MAX'), 177 ('c:macro', 'LLONG_MIN'), 178 ('c:macro', 'LONG_MAX'), 179 ('c:macro', 'LONG_MIN'), 180 # Standard C variables 181 ('c:data', 'errno'), 182 # Standard environment variables 183 ('envvar', 'BROWSER'), 184 ('envvar', 'COLUMNS'), 185 ('envvar', 'COMSPEC'), 186 ('envvar', 'DISPLAY'), 187 ('envvar', 'HOME'), 188 ('envvar', 'HOMEDRIVE'), 189 ('envvar', 'HOMEPATH'), 190 ('envvar', 'IDLESTARTUP'), 191 ('envvar', 'LANG'), 192 ('envvar', 'LANGUAGE'), 193 ('envvar', 'LC_ALL'), 194 ('envvar', 'LC_CTYPE'), 195 ('envvar', 'LC_COLLATE'), 196 ('envvar', 'LC_MESSAGES'), 197 ('envvar', 'LC_MONETARY'), 198 ('envvar', 'LC_NUMERIC'), 199 ('envvar', 'LC_TIME'), 200 ('envvar', 'LINES'), 201 ('envvar', 'LOGNAME'), 202 ('envvar', 'MANPAGER'), 203 ('envvar', 'PAGER'), 204 ('envvar', 'PATH'), 205 ('envvar', 'PATHEXT'), 206 ('envvar', 'SOURCE_DATE_EPOCH'), 207 ('envvar', 'TEMP'), 208 ('envvar', 'TERM'), 209 ('envvar', 'TMP'), 210 ('envvar', 'TMPDIR'), 211 ('envvar', 'TZ'), 212 ('envvar', 'USER'), 213 ('envvar', 'USERNAME'), 214 ('envvar', 'USERPROFILE'), 215 # Deprecated function that was never documented: 216 ('py:func', 'getargspec'), 217 ('py:func', 'inspect.getargspec'), 218 # Undocumented modules that users shouldn't have to worry about 219 # (implementation details of `os.path`): 220 ('py:mod', 'ntpath'), 221 ('py:mod', 'posixpath'), 222] 223 224# Temporary undocumented names. 225# In future this list must be empty. 226nitpick_ignore += [ 227 # C API: Standard Python exception classes 228 ('c:data', 'PyExc_ArithmeticError'), 229 ('c:data', 'PyExc_AssertionError'), 230 ('c:data', 'PyExc_AttributeError'), 231 ('c:data', 'PyExc_BaseException'), 232 ('c:data', 'PyExc_BlockingIOError'), 233 ('c:data', 'PyExc_BrokenPipeError'), 234 ('c:data', 'PyExc_BufferError'), 235 ('c:data', 'PyExc_ChildProcessError'), 236 ('c:data', 'PyExc_ConnectionAbortedError'), 237 ('c:data', 'PyExc_ConnectionError'), 238 ('c:data', 'PyExc_ConnectionRefusedError'), 239 ('c:data', 'PyExc_ConnectionResetError'), 240 ('c:data', 'PyExc_EOFError'), 241 ('c:data', 'PyExc_Exception'), 242 ('c:data', 'PyExc_FileExistsError'), 243 ('c:data', 'PyExc_FileNotFoundError'), 244 ('c:data', 'PyExc_FloatingPointError'), 245 ('c:data', 'PyExc_GeneratorExit'), 246 ('c:data', 'PyExc_ImportError'), 247 ('c:data', 'PyExc_IndentationError'), 248 ('c:data', 'PyExc_IndexError'), 249 ('c:data', 'PyExc_InterruptedError'), 250 ('c:data', 'PyExc_IsADirectoryError'), 251 ('c:data', 'PyExc_KeyboardInterrupt'), 252 ('c:data', 'PyExc_KeyError'), 253 ('c:data', 'PyExc_LookupError'), 254 ('c:data', 'PyExc_MemoryError'), 255 ('c:data', 'PyExc_ModuleNotFoundError'), 256 ('c:data', 'PyExc_NameError'), 257 ('c:data', 'PyExc_NotADirectoryError'), 258 ('c:data', 'PyExc_NotImplementedError'), 259 ('c:data', 'PyExc_OSError'), 260 ('c:data', 'PyExc_OverflowError'), 261 ('c:data', 'PyExc_PermissionError'), 262 ('c:data', 'PyExc_ProcessLookupError'), 263 ('c:data', 'PyExc_PythonFinalizationError'), 264 ('c:data', 'PyExc_RecursionError'), 265 ('c:data', 'PyExc_ReferenceError'), 266 ('c:data', 'PyExc_RuntimeError'), 267 ('c:data', 'PyExc_StopAsyncIteration'), 268 ('c:data', 'PyExc_StopIteration'), 269 ('c:data', 'PyExc_SyntaxError'), 270 ('c:data', 'PyExc_SystemError'), 271 ('c:data', 'PyExc_SystemExit'), 272 ('c:data', 'PyExc_TabError'), 273 ('c:data', 'PyExc_TimeoutError'), 274 ('c:data', 'PyExc_TypeError'), 275 ('c:data', 'PyExc_UnboundLocalError'), 276 ('c:data', 'PyExc_UnicodeDecodeError'), 277 ('c:data', 'PyExc_UnicodeEncodeError'), 278 ('c:data', 'PyExc_UnicodeError'), 279 ('c:data', 'PyExc_UnicodeTranslateError'), 280 ('c:data', 'PyExc_ValueError'), 281 ('c:data', 'PyExc_ZeroDivisionError'), 282 # C API: Standard Python warning classes 283 ('c:data', 'PyExc_BytesWarning'), 284 ('c:data', 'PyExc_DeprecationWarning'), 285 ('c:data', 'PyExc_FutureWarning'), 286 ('c:data', 'PyExc_ImportWarning'), 287 ('c:data', 'PyExc_PendingDeprecationWarning'), 288 ('c:data', 'PyExc_ResourceWarning'), 289 ('c:data', 'PyExc_RuntimeWarning'), 290 ('c:data', 'PyExc_SyntaxWarning'), 291 ('c:data', 'PyExc_UnicodeWarning'), 292 ('c:data', 'PyExc_UserWarning'), 293 ('c:data', 'PyExc_Warning'), 294 # Undocumented public C macros 295 ('c:macro', 'Py_BUILD_ASSERT'), 296 ('c:macro', 'Py_BUILD_ASSERT_EXPR'), 297 # Do not error nit-picky mode builds when _SubParsersAction.add_parser cannot 298 # be resolved, as the method is currently undocumented. For context, see 299 # https://github.com/python/cpython/pull/103289. 300 ('py:meth', '_SubParsersAction.add_parser'), 301 # Attributes/methods/etc. that definitely should be documented better, 302 # but are deferred for now: 303 ('py:attr', '__annotations__'), 304 ('py:meth', '__missing__'), 305 ('py:attr', '__wrapped__'), 306 ('py:attr', 'decimal.Context.clamp'), 307 ('py:meth', 'index'), # list.index, tuple.index, etc. 308] 309 310# gh-106948: Copy standard C types declared in the "c:type" domain and C 311# structures declared in the "c:struct" domain to the "c:identifier" domain, 312# since "c:function" markup looks for types in the "c:identifier" domain. Use 313# list() to not iterate on items which are being added 314for role, name in list(nitpick_ignore): 315 if role in ('c:type', 'c:struct'): 316 nitpick_ignore.append(('c:identifier', name)) 317del role, name 318 319# Disable Docutils smartquotes for several translations 320smartquotes_excludes = { 321 'languages': ['ja', 'fr', 'zh_TW', 'zh_CN'], 322 'builders': ['man', 'text'], 323} 324 325# Avoid a warning with Sphinx >= 4.0 326root_doc = 'contents' 327 328# Allow translation of index directives 329gettext_additional_targets = [ 330 'index', 331 'literal-block', 332] 333 334# Options for HTML output 335# ----------------------- 336 337# Use our custom theme: https://github.com/python/python-docs-theme 338html_theme = 'python_docs_theme' 339# Location of overrides for theme templates and static files 340html_theme_path = ['tools'] 341html_theme_options = { 342 'collapsiblesidebar': True, 343 'issues_url': '/bugs.html', 344 'license_url': '/license.html', 345 'root_include_title': False, # We use the version switcher instead. 346} 347 348if os.getenv("READTHEDOCS"): 349 html_theme_options["hosted_on"] = ( 350 '<a href="https://about.readthedocs.com/">Read the Docs</a>' 351 ) 352 353# Override stylesheet fingerprinting for Windows CHM htmlhelp to fix GH-91207 354# https://github.com/python/cpython/issues/91207 355if any('htmlhelp' in arg for arg in sys.argv): 356 html_style = 'pydoctheme.css' 357 print("\nWARNING: Windows CHM Help is no longer supported.") 358 print("It may be removed in the future\n") 359 360# Short title used e.g. for <title> HTML tags. 361html_short_title = f'{release} Documentation' 362 363# Deployment preview information 364# (See .readthedocs.yml and https://docs.readthedocs.io/en/stable/reference/environment-variables.html) 365is_deployment_preview = os.getenv("READTHEDOCS_VERSION_TYPE") == "external" 366repository_url = os.getenv("READTHEDOCS_GIT_CLONE_URL", "") 367repository_url = repository_url.removesuffix(".git") 368html_context = { 369 "is_deployment_preview": is_deployment_preview, 370 "repository_url": repository_url or None, 371 "pr_id": os.getenv("READTHEDOCS_VERSION"), 372 "enable_analytics": os.getenv("PYTHON_DOCS_ENABLE_ANALYTICS"), 373} 374 375# This 'Last updated on:' timestamp is inserted at the bottom of every page. 376html_last_updated_fmt = '%b %d, %Y (%H:%M UTC)' 377if sphinx.version_info[:2] >= (8, 1): 378 html_last_updated_use_utc = True 379else: 380 html_time = int(os.environ.get('SOURCE_DATE_EPOCH', time.time())) 381 html_last_updated_fmt = time.strftime( 382 html_last_updated_fmt, time.gmtime(html_time) 383 ) 384 385# Path to find HTML templates to override theme 386templates_path = ['tools/templates'] 387 388# Custom sidebar templates, filenames relative to this file. 389html_sidebars = { 390 # Defaults taken from https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_sidebars 391 # Removes the quick search block 392 '**': ['localtoc.html', 'relations.html', 'customsourcelink.html'], 393 'index': ['indexsidebar.html'], 394} 395 396# Additional templates that should be rendered to pages. 397html_additional_pages = { 398 'download': 'download.html', 399 'index': 'indexcontent.html', 400} 401 402# Output an OpenSearch description file. 403html_use_opensearch = 'https://docs.python.org/' + version 404 405# Additional static files. 406html_static_path = ['_static', 'tools/static'] 407 408# Output file base name for HTML help builder. 409htmlhelp_basename = 'python' + release.replace('.', '') 410 411# Split the index 412html_split_index = True 413 414# Split pot files one per reST file 415gettext_compact = False 416 417# Options for LaTeX output 418# ------------------------ 419 420latex_engine = 'xelatex' 421 422latex_elements = { 423 # For the LaTeX preamble. 424 'preamble': r''' 425\authoraddress{ 426 \sphinxstrong{Python Software Foundation}\\ 427 Email: \sphinxemail{docs@python.org} 428} 429\let\Verbatim=\OriginalVerbatim 430\let\endVerbatim=\endOriginalVerbatim 431\setcounter{tocdepth}{2} 432''', 433 # The paper size ('letterpaper' or 'a4paper'). 434 'papersize': 'a4paper', 435 # The font size ('10pt', '11pt' or '12pt'). 436 'pointsize': '10pt', 437} 438 439# Grouping the document tree into LaTeX files. List of tuples 440# (source start file, target name, title, author, document class [howto/manual]). 441_stdauthor = 'Guido van Rossum and the Python development team' 442latex_documents = [ 443 ('c-api/index', 'c-api.tex', 'The Python/C API', _stdauthor, 'manual'), 444 ( 445 'extending/index', 446 'extending.tex', 447 'Extending and Embedding Python', 448 _stdauthor, 449 'manual', 450 ), 451 ( 452 'installing/index', 453 'installing.tex', 454 'Installing Python Modules', 455 _stdauthor, 456 'manual', 457 ), 458 ( 459 'library/index', 460 'library.tex', 461 'The Python Library Reference', 462 _stdauthor, 463 'manual', 464 ), 465 ( 466 'reference/index', 467 'reference.tex', 468 'The Python Language Reference', 469 _stdauthor, 470 'manual', 471 ), 472 ( 473 'tutorial/index', 474 'tutorial.tex', 475 'Python Tutorial', 476 _stdauthor, 477 'manual', 478 ), 479 ( 480 'using/index', 481 'using.tex', 482 'Python Setup and Usage', 483 _stdauthor, 484 'manual', 485 ), 486 ( 487 'faq/index', 488 'faq.tex', 489 'Python Frequently Asked Questions', 490 _stdauthor, 491 'manual', 492 ), 493 ( 494 'whatsnew/' + version, 495 'whatsnew.tex', 496 'What\'s New in Python', 497 'A. M. Kuchling', 498 'howto', 499 ), 500] 501# Collect all HOWTOs individually 502latex_documents.extend( 503 ('howto/' + fn[:-4], 'howto-' + fn[:-4] + '.tex', '', _stdauthor, 'howto') 504 for fn in os.listdir('howto') 505 if fn.endswith('.rst') and fn != 'index.rst' 506) 507 508# Documents to append as an appendix to all manuals. 509latex_appendices = ['glossary', 'about', 'license', 'copyright'] 510 511# Options for Epub output 512# ----------------------- 513 514epub_author = 'Python Documentation Authors' 515epub_publisher = 'Python Software Foundation' 516 517# index pages are not valid xhtml 518# https://github.com/sphinx-doc/sphinx/issues/12359 519epub_use_index = False 520 521# Options for the coverage checker 522# -------------------------------- 523 524# The coverage checker will ignore all modules/functions/classes whose names 525# match any of the following regexes (using re.match). 526coverage_ignore_modules = [ 527 r'[T|t][k|K]', 528] 529 530coverage_ignore_functions = [ 531 'test($|_)', 532] 533 534coverage_ignore_classes = [] 535 536# Glob patterns for C source files for C API coverage, relative to this directory. 537coverage_c_path = [ 538 '../Include/*.h', 539] 540 541# Regexes to find C items in the source files. 542coverage_c_regexes = { 543 'cfunction': r'^PyAPI_FUNC\(.*\)\s+([^_][\w_]+)', 544 'data': r'^PyAPI_DATA\(.*\)\s+([^_][\w_]+)', 545 'macro': r'^#define ([^_][\w_]+)\(.*\)[\s|\\]', 546} 547 548# The coverage checker will ignore all C items whose names match these regexes 549# (using re.match) -- the keys must be the same as in coverage_c_regexes. 550coverage_ignore_c_items = { 551 # 'cfunction': [...] 552} 553 554 555# Options for the link checker 556# ---------------------------- 557 558linkcheck_allowed_redirects = { 559 # bpo-NNNN -> BPO -> GH Issues 560 r'https://bugs.python.org/issue\?@action=redirect&bpo=\d+': r'https://github.com/python/cpython/issues/\d+', 561 # GH-NNNN used to refer to pull requests 562 r'https://github.com/python/cpython/issues/\d+': r'https://github.com/python/cpython/pull/\d+', 563 # :source:`something` linking files in the repository 564 r'https://github.com/python/cpython/tree/.*': 'https://github.com/python/cpython/blob/.*', 565 # Intentional HTTP use at Misc/NEWS.d/3.5.0a1.rst 566 r'http://www.python.org/$': 'https://www.python.org/$', 567 # Used in license page, keep as is 568 r'https://www.zope.org/': r'https://www.zope.dev/', 569 # Microsoft's redirects to learn.microsoft.com 570 r'https://msdn.microsoft.com/.*': 'https://learn.microsoft.com/.*', 571 r'https://docs.microsoft.com/.*': 'https://learn.microsoft.com/.*', 572 r'https://go.microsoft.com/fwlink/\?LinkID=\d+': 'https://learn.microsoft.com/.*', 573 # Debian's man page redirects to its current stable version 574 r'https://manpages.debian.org/\w+\(\d(\w+)?\)': r'https://manpages.debian.org/\w+/[\w/\-\.]*\.\d(\w+)?\.en\.html', 575 # Language redirects 576 r'https://toml.io': 'https://toml.io/en/', 577 r'https://www.redhat.com': 'https://www.redhat.com/en', 578 # pypi.org project name normalization (upper to lowercase, underscore to hyphen) 579 r'https://pypi.org/project/[A-Za-z\d_\-\.]+/': r'https://pypi.org/project/[a-z\d\-\.]+/', 580 # Discourse title name expansion (text changes when title is edited) 581 r'https://discuss\.python\.org/t/\d+': r'https://discuss\.python\.org/t/.*/\d+', 582 # Other redirects 583 r'https://www.boost.org/libs/.+': r'https://www.boost.org/doc/libs/\d_\d+_\d/.+', 584 r'https://support.microsoft.com/en-us/help/\d+': 'https://support.microsoft.com/en-us/topic/.+', 585 r'https://perf.wiki.kernel.org$': 'https://perf.wiki.kernel.org/index.php/Main_Page', 586 r'https://www.sqlite.org': 'https://www.sqlite.org/index.html', 587 r'https://mitpress.mit.edu/sicp$': 'https://mitpress.mit.edu/9780262510875/structure-and-interpretation-of-computer-programs/', 588 r'https://www.python.org/psf/': 'https://www.python.org/psf-landing/', 589} 590 591linkcheck_anchors_ignore = [ 592 # ignore anchors that start with a '/', e.g. Wikipedia media files: 593 # https://en.wikipedia.org/wiki/Walrus#/media/File:Pacific_Walrus_-_Bull_(8247646168).jpg 594 r'\/.*', 595] 596 597linkcheck_ignore = [ 598 # The crawler gets "Anchor not found" 599 r'https://developer.apple.com/documentation/.+?#.*', 600 r'https://devguide.python.org.+?/#.*', 601 r'https://github.com.+?#.*', 602 # Robot crawlers not allowed: "403 Client Error: Forbidden" 603 r'https://support.enthought.com/hc/.*', 604 # SSLError CertificateError, even though it is valid 605 r'https://unix.org/version2/whatsnew/lp64_wp.html', 606] 607 608# Options for sphinx.ext.extlinks 609# ------------------------------- 610 611# This config is a dictionary of external sites, 612# mapping unique short aliases to a base URL and a prefix. 613# https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html 614extlinks = { 615 "pypi": ("https://pypi.org/project/%s/", "%s"), 616 "source": (SOURCE_URI, "%s"), 617} 618extlinks_detect_hardcoded_links = True 619 620if sphinx.version_info[:2] < (8, 1): 621 # Sphinx 8.1 has in-built CVE and CWE roles. 622 extlinks |= { 623 "cve": ( 624 "https://www.cve.org/CVERecord?id=CVE-%s", 625 "CVE-%s", 626 ), 627 "cwe": ("https://cwe.mitre.org/data/definitions/%s.html", "CWE-%s"), 628 } 629 630# Options for c_annotations extension 631# ----------------------------------- 632 633# Relative filename of the data files 634refcount_file = 'data/refcounts.dat' 635stable_abi_file = 'data/stable_abi.dat' 636 637# Options for sphinxext-opengraph 638# ------------------------------- 639 640ogp_site_url = 'https://docs.python.org/3/' 641ogp_site_name = 'Python documentation' 642ogp_image = '_static/og-image.png' 643ogp_custom_meta_tags = [ 644 '<meta property="og:image:width" content="200" />', 645 '<meta property="og:image:height" content="200" />', 646 '<meta name="theme-color" content="#3776ab" />', 647] 648