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",
|
|
|
|
"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
|
|
|
}
|
|
|
|
|
|
|
|
# List of patterns (relative to source dir) to ignore 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",
|
|
|
|
# Documentation
|
|
|
|
"docs/*.rst",
|
|
|
|
]
|
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 = {
|
|
|
|
'python': ('https://docs.python.org/3/', None),
|
|
|
|
'packaging': ('https://packaging.python.org/en/latest/', None),
|
2024-01-12 02:20:09 -05:00
|
|
|
'typing': ('https://typing.readthedocs.io/en/latest/', None),
|
2023-05-09 05:44:32 -04:00
|
|
|
'devguide': ('https://devguide.python.org/', None),
|
2023-02-15 07:32:31 -05:00
|
|
|
'py3.11': ('https://docs.python.org/3.11/', None),
|
2023-03-02 05:28:07 -05:00
|
|
|
'py3.12': ('https://docs.python.org/3.12/', None),
|
2022-08-02 23:48:56 -04:00
|
|
|
}
|
|
|
|
intersphinx_disabled_reftypes = []
|
|
|
|
|
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
|
|
|
|
2023-09-02 23:55:19 -04:00
|
|
|
templates_path = [os.fspath(_PSE_PATH / "pep_theme" / "templates")] # Theme template relative paths from `confdir`
|