2022-01-16 17:33:05 -05:00
|
|
|
# This file is placed in the public domain or under the
|
|
|
|
# CC0-1.0-Universal license, whichever is more permissive.
|
|
|
|
|
2021-06-08 19:11:26 -04:00
|
|
|
"""Configuration for building PEPs using Sphinx."""
|
|
|
|
|
2023-09-02 23:55:19 -04:00
|
|
|
import os
|
2021-06-08 20:37:55 -04:00
|
|
|
from pathlib import Path
|
2021-06-30 15:19:44 -04:00
|
|
|
import sys
|
2021-06-08 20:37:55 -04:00
|
|
|
|
2023-09-09 13:39:29 -04:00
|
|
|
_ROOT = Path(__file__).resolve().parent.parent
|
2023-09-02 23:55:19 -04:00
|
|
|
sys.path.append(os.fspath(_ROOT))
|
2021-06-08 20:37:55 -04:00
|
|
|
|
2021-06-08 19:11:26 -04:00
|
|
|
# -- Project information -----------------------------------------------------
|
|
|
|
|
|
|
|
project = "PEPs"
|
|
|
|
master_doc = "contents"
|
|
|
|
|
|
|
|
# -- General configuration ---------------------------------------------------
|
|
|
|
|
2021-06-08 20:37:55 -04:00
|
|
|
# Add any Sphinx extension module names here, as strings.
|
2022-08-02 23:48:56 -04:00
|
|
|
extensions = [
|
2022-10-05 13:03:04 -04:00
|
|
|
"pep_sphinx_extensions",
|
2024-05-25 09:48:58 -04:00
|
|
|
"sphinx.ext.extlinks",
|
2022-10-05 13:03:04 -04:00
|
|
|
"sphinx.ext.intersphinx",
|
|
|
|
"sphinx.ext.githubpages",
|
2022-08-02 23:48:56 -04:00
|
|
|
]
|
2021-06-08 20:37:55 -04:00
|
|
|
|
2021-06-08 19:11:26 -04:00
|
|
|
# The file extensions of source files. Sphinx uses these suffixes as sources.
|
|
|
|
source_suffix = {
|
2021-06-08 20:37:55 -04:00
|
|
|
".rst": "pep",
|
2021-06-08 19:11:26 -04:00
|
|
|
}
|
|
|
|
|
2024-07-17 01:04:03 -04:00
|
|
|
# List of patterns (relative to source dir) to include when looking for source files.
|
2022-03-13 21:44:36 -04:00
|
|
|
include_patterns = [
|
|
|
|
# Required for Sphinx
|
|
|
|
"contents.rst",
|
|
|
|
# PEP files
|
|
|
|
"pep-????.rst",
|
|
|
|
# PEP ancillary files
|
|
|
|
"pep-????/*.rst",
|
2024-07-17 01:04:03 -04:00
|
|
|
# PEPs API
|
|
|
|
"api/*.rst",
|
2022-03-13 21:44:36 -04:00
|
|
|
# Documentation
|
|
|
|
"docs/*.rst",
|
|
|
|
]
|
2024-07-17 01:04:03 -04:00
|
|
|
# And to ignore when looking for source files.
|
2021-06-08 19:11:26 -04:00
|
|
|
exclude_patterns = [
|
2022-03-13 21:44:36 -04:00
|
|
|
# PEP Template
|
|
|
|
"pep-0012/pep-NNNN.rst",
|
2021-06-08 19:11:26 -04:00
|
|
|
]
|
|
|
|
|
2023-08-05 07:59:14 -04:00
|
|
|
# Warn on missing references
|
|
|
|
nitpicky = True
|
|
|
|
|
2022-08-02 23:48:56 -04:00
|
|
|
# Intersphinx configuration
|
|
|
|
intersphinx_mapping = {
|
2024-07-17 01:04:03 -04:00
|
|
|
"python": ("https://docs.python.org/3/", None),
|
|
|
|
"packaging": ("https://packaging.python.org/en/latest/", None),
|
|
|
|
"typing": ("https://typing.readthedocs.io/en/latest/", None),
|
|
|
|
"trio": ("https://trio.readthedocs.io/en/latest/", None),
|
|
|
|
"devguide": ("https://devguide.python.org/", None),
|
|
|
|
"py3.11": ("https://docs.python.org/3.11/", None),
|
|
|
|
"py3.12": ("https://docs.python.org/3.12/", None),
|
|
|
|
"py3.13": ("https://docs.python.org/3.13/", None),
|
2022-08-02 23:48:56 -04:00
|
|
|
}
|
|
|
|
intersphinx_disabled_reftypes = []
|
|
|
|
|
2024-05-25 09:48:58 -04:00
|
|
|
# sphinx.ext.extlinks
|
|
|
|
# This config is a dictionary of external sites,
|
|
|
|
# mapping unique short aliases to a base URL and a prefix.
|
|
|
|
# https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html
|
|
|
|
extlinks = {
|
|
|
|
"pypi": ("https://pypi.org/project/%s/", "%s"),
|
|
|
|
}
|
|
|
|
|
2021-06-08 19:11:26 -04:00
|
|
|
# -- Options for HTML output -------------------------------------------------
|
|
|
|
|
2023-09-02 23:55:19 -04:00
|
|
|
_PSE_PATH = _ROOT / "pep_sphinx_extensions"
|
|
|
|
|
2021-06-08 19:11:26 -04:00
|
|
|
# HTML output settings
|
2021-06-08 20:37:55 -04:00
|
|
|
html_math_renderer = "maths_to_html" # Maths rendering
|
2021-06-30 15:19:44 -04:00
|
|
|
|
|
|
|
# Theme settings
|
2023-09-02 23:55:19 -04:00
|
|
|
html_theme_path = [os.fspath(_PSE_PATH)]
|
2021-06-30 15:19:44 -04:00
|
|
|
html_theme = "pep_theme" # The actual theme directory (child of html_theme_path)
|
|
|
|
html_use_index = False # Disable index (we use PEP 0)
|
|
|
|
html_style = "" # must be defined here or in theme.conf, but is unused
|
|
|
|
html_permalinks = False # handled in the PEPContents transform
|
2022-03-09 14:00:12 -05:00
|
|
|
html_baseurl = "https://peps.python.org" # to create the CNAME file
|
2022-01-09 13:07:03 -05:00
|
|
|
gettext_auto_build = False # speed-ups
|
2021-06-30 15:19:44 -04:00
|
|
|
|
2024-07-17 01:04:03 -04:00
|
|
|
# Theme template relative paths from `confdir`
|
|
|
|
templates_path = [os.fspath(_PSE_PATH / "pep_theme" / "templates")]
|