|
1
|
|
|
""" |
|
2
|
|
|
Sphinx configuration. |
|
3
|
|
|
""" |
|
4
|
|
|
|
|
5
|
|
|
# noqa: INP001 |
|
6
|
|
|
# Configuration file for the Sphinx documentation builder. |
|
7
|
|
|
# |
|
8
|
|
|
# This file does only contain a selection of the most common options. For a |
|
9
|
|
|
# full list see the documentation: |
|
10
|
|
|
# http://www.sphinx-doc.org/en/master/config |
|
11
|
|
|
|
|
12
|
|
|
# -- Path setup -------------------------------------------------------------- |
|
13
|
|
|
|
|
14
|
|
|
import datetime |
|
15
|
|
|
import os |
|
16
|
|
|
import sys |
|
17
|
|
|
|
|
18
|
|
|
# noinspection PyCompatibility |
|
19
|
|
|
import tomllib |
|
20
|
|
|
|
|
21
|
|
|
sys.path.insert(0, os.path.abspath("../..")) |
|
22
|
|
|
|
|
23
|
|
|
on_rtd = os.environ.get("READTHEDOCS") == "True" |
|
24
|
|
|
|
|
25
|
|
|
# -- Project information ----------------------------------------------------- |
|
26
|
|
|
|
|
27
|
|
|
with open("../pyproject.toml", "rb") as f: |
|
28
|
|
|
data = tomllib.load(f) |
|
29
|
|
|
project = data["project"]["name"] |
|
30
|
|
|
author = ",".join(author["name"] for author in data["project"]["authors"]) |
|
31
|
|
|
release = os.popen("hatch version").readline().strip() # noqa: S605, S607 |
|
32
|
|
|
year = datetime.datetime.now(tz=datetime.UTC).date().year |
|
33
|
|
|
copyright = f"2024-{year}, {author}" # noqa: A001 |
|
34
|
|
|
|
|
35
|
|
|
# The short X.Y version |
|
36
|
|
|
version = ".".join(release.split(".")[:2]) |
|
37
|
|
|
|
|
38
|
|
|
# -- General configuration --------------------------------------------------- |
|
39
|
|
|
|
|
40
|
|
|
# If your documentation needs a minimal Sphinx version, state it here. |
|
41
|
|
|
# |
|
42
|
|
|
needs_sphinx = "8.1" |
|
43
|
|
|
|
|
44
|
|
|
# Add any Sphinx extension module names here, as strings. They can be |
|
45
|
|
|
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
|
46
|
|
|
# ones. |
|
47
|
|
|
extensions = ["myst_parser", "sphinx_copybutton"] |
|
48
|
|
|
|
|
49
|
|
|
copybutton_prompt_text = r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: " |
|
50
|
|
|
copybutton_prompt_is_regexp = True |
|
51
|
|
|
copybutton_line_continuation_character = "\\" |
|
52
|
|
|
|
|
53
|
|
|
# Add any paths that contain templates here, relative to this directory. |
|
54
|
|
|
templates_path = [] |
|
55
|
|
|
|
|
56
|
|
|
# The suffix(es) of source filenames. |
|
57
|
|
|
# You can specify multiple suffix as a list of string: |
|
58
|
|
|
# |
|
59
|
|
|
source_suffix = { |
|
60
|
|
|
".rst": "restructuredtext", |
|
61
|
|
|
".md": "markdown", |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
|
|
65
|
|
|
# The master document. |
|
66
|
|
|
master_doc = "index" |
|
67
|
|
|
|
|
68
|
|
|
# The language for content auto-generated by Sphinx. Refer to documentation |
|
69
|
|
|
# for a list of supported languages. |
|
70
|
|
|
# |
|
71
|
|
|
# This is also used if you do content translation via gettext catalogs. |
|
72
|
|
|
# Usually you set "language" from the command line for these cases. |
|
73
|
|
|
language = "en" |
|
74
|
|
|
|
|
75
|
|
|
# List of patterns, relative to source directory, that match files and |
|
76
|
|
|
# directories to ignore when looking for source files. |
|
77
|
|
|
# This pattern also affects html_static_path and html_extra_path. |
|
78
|
|
|
exclude_patterns = ["images"] |
|
79
|
|
|
|
|
80
|
|
|
# The name of the syntax highlighting style to use. |
|
81
|
|
|
pygments_style = "sphinx" |
|
82
|
|
|
|
|
83
|
|
|
|
|
84
|
|
|
# -- Options for HTML output ------------------------------------------------- |
|
85
|
|
|
|
|
86
|
|
|
# The theme to use for HTML and HTML Help pages. See the documentation for |
|
87
|
|
|
# a list of builtin themes. |
|
88
|
|
|
# |
|
89
|
|
|
html_theme = "sphinx_rtd_theme" |
|
90
|
|
|
|
|
91
|
|
|
# Theme options are theme-specific and customize the look and feel of a theme |
|
92
|
|
|
# further. For a list of options available for each theme, see the |
|
93
|
|
|
# documentation. |
|
94
|
|
|
# |
|
95
|
|
|
# html_theme_options = {} |
|
96
|
|
|
|
|
97
|
|
|
# Add any paths that contain custom static files (such as style sheets) here, |
|
98
|
|
|
# relative to this directory. They are copied after the builtin static files, |
|
99
|
|
|
# so a file named "default.css" will overwrite the builtin "default.css". |
|
100
|
|
|
html_static_path = [] |
|
101
|
|
|
|
|
102
|
|
|
# Custom sidebar templates, must be a dictionary that maps document names |
|
103
|
|
|
# to template names. |
|
104
|
|
|
# |
|
105
|
|
|
# html_sidebars = {} |
|
106
|
|
|
|