1
|
|
|
# Configuration file for the Sphinx documentation builder. |
2
|
|
|
# |
3
|
|
|
# This file only contains a selection of the most common options. For a full |
4
|
|
|
# list see the documentation: |
5
|
|
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html |
6
|
|
|
|
7
|
|
|
# -- Path setup -------------------------------------------------------------- |
8
|
|
|
# If extensions (or modules to document with autodoc) are in another directory, |
9
|
|
|
# add these directories to sys.path here. If the directory is relative to the |
10
|
|
|
# documentation root, use os.path.abspath to make it absolute, like shown here. |
11
|
|
|
import os |
12
|
|
|
import sys |
13
|
|
|
|
14
|
|
|
sys.path.append(os.path.abspath("..")) |
15
|
|
|
sys.path.append(os.path.abspath("../..")) |
16
|
|
|
sys.path.append(os.path.abspath("extensions")) |
17
|
|
|
|
18
|
|
|
from pincer import __version__ |
19
|
|
|
|
20
|
|
|
# -- Project information ----------------------------------------------------- |
21
|
|
|
|
22
|
|
|
|
23
|
|
|
project = "Pincer Library" |
24
|
|
|
copyright = "2021, Pincer" |
25
|
|
|
author = "Sigmanificient, Arthurdw" |
26
|
|
|
|
27
|
|
|
|
28
|
|
|
# The full version, including alpha/beta/rc tags. |
29
|
|
|
release = __version__ |
30
|
|
|
|
31
|
|
|
branch = "main" if __version__.endswith("a") else "v" + __version__ |
32
|
|
|
|
33
|
|
|
# -- General configuration --------------------------------------------------- |
34
|
|
|
|
35
|
|
|
|
36
|
|
|
# Add any Sphinx extension module names here, as strings. They can be |
37
|
|
|
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
38
|
|
|
# ones. |
39
|
|
|
extensions = [ |
40
|
|
|
"sphinx_design", |
41
|
|
|
"sphinx.ext.napoleon", |
42
|
|
|
"sphinx.ext.autodoc", |
43
|
|
|
"sphinx.ext.intersphinx", |
44
|
|
|
"exception_hierarchy", |
45
|
|
|
"attributetable", |
46
|
|
|
"silence", |
47
|
|
|
"sphinxcontrib_trio", |
48
|
|
|
"sphinxcontrib.mermaid", |
49
|
|
|
] |
50
|
|
|
|
51
|
|
|
add_module_names = False |
52
|
|
|
|
53
|
|
|
autodoc_typehints = "none" |
54
|
|
|
|
55
|
|
|
autodoc_member_order = "alphabetical" |
56
|
|
|
|
57
|
|
|
set_type_checking_flag = True |
58
|
|
|
|
59
|
|
|
mermaid_output_format = "raw" |
60
|
|
|
|
61
|
|
|
resource_links = { |
62
|
|
|
"discord": "https://discord.gg/et54DgVjMX", |
63
|
|
|
"issues": "https://github.com/Pincer-org/Pincer/issues", |
64
|
|
|
"discussions": "https://github.com/Pincer-org/Pincer/discussions", |
65
|
|
|
"examples": f"https://github.com/Pincer-org/Pincer/tree/{branch}/examples", |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
intersphinx_mapping = { |
69
|
|
|
"py": ("https://docs.python.org/3", None), |
70
|
|
|
"ws": ("https://websockets.readthedocs.io/en/stable", None), |
71
|
|
|
"pil": ("https://pillow.readthedocs.io/en/stable", None), |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
# Add any paths that contain templates here, relative to this directory. |
75
|
|
|
# templates_path = ['_templates'] |
76
|
|
|
|
77
|
|
|
# List of patterns, relative to source directory, that match files and |
78
|
|
|
# directories to ignore when looking for source files. |
79
|
|
|
# This pattern also affects html_static_path and html_extra_path. |
80
|
|
|
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] |
81
|
|
|
|
82
|
|
|
autodoc_default_options = {"members": True, "show-inheritance": True} |
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_logo = "../assets/img/icon_small.png" |
90
|
|
|
html_favicon = "../assets/img/icon.ico" |
91
|
|
|
html_theme = "furo" |
92
|
|
|
# Material theme options (see theme.conf for more information) |
93
|
|
|
html_theme_options = { |
94
|
|
|
"light_css_variables": { |
95
|
|
|
"color-brand-primary": "#4C8CBF", |
96
|
|
|
"color-brand-content": "#306998", |
97
|
|
|
"color-admonition-background": "blue", |
98
|
|
|
}, |
99
|
|
|
"dark_css_variables": { |
100
|
|
|
"color-brand-primary": "#306998", |
101
|
|
|
"color-brand-content": "#FFE871", |
102
|
|
|
"color-admonition-background": "yellow", |
103
|
|
|
}, |
104
|
|
|
"sidebar_hide_name": True, |
105
|
|
|
} |
106
|
|
|
pygments_style = "monokai" |
107
|
|
|
default_dark_mode = True |
108
|
|
|
# Add any paths that contain custom static files (such as style sheets) here, |
109
|
|
|
# relative to this directory. They are copied after the builtin static files, |
110
|
|
|
# so a file named 'default.css' will overwrite the builtin 'default.css'. |
111
|
|
|
html_static_path = ["_static"] |
112
|
|
|
html_css_files = ["custom.css"] |
113
|
|
|
|
114
|
|
|
rst_prolog = """ |
115
|
|
|
.. |coro| replace:: This function is a |coroutine_link|_.\n\n |
116
|
|
|
.. |maybecoro| replace:: This function *could be a* |coroutine_link|_. |
117
|
|
|
.. |coroutine_link| replace:: *coroutine* |
118
|
|
|
.. _coroutine_link: https://docs.python.org/3/library/asyncio-task.html#coroutine |
119
|
|
|
.. |default| raw:: html |
120
|
|
|
|
121
|
|
|
<div class="default-value-section"> <span class="default-value-label">Default:</span> |
122
|
|
|
""" |
123
|
|
|
|
124
|
|
|
# The suffix of source filenames. |
125
|
|
|
source_suffix = ".rst" |
126
|
|
|
|