This repository was archived by the owner on Dec 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconf.py
More file actions
199 lines (180 loc) · 5.29 KB
/
Copy pathconf.py
File metadata and controls
199 lines (180 loc) · 5.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# SPDX-FileCopyrightText: 2023 Jose D. Montoya
#
# SPDX-License-Identifier: MIT
import os
import sys
import datetime
sys.path.insert(0, os.path.abspath(".."))
try:
# Inject mock modules so that we can build the
# documentation without having the real stuff available
from mock import Mock
to_be_mocked = [
"micropython",
"machine",
]
for module in to_be_mocked:
sys.modules[module] = Mock()
print("Mocked '{}' module".format(module))
import micropython_adt7410
except ImportError:
raise SystemExit("micropython_adt7410 has to be importable")
# -- General configuration ------------------------------------------------
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"sphinx_immaterial",
]
autodoc_preserve_defaults = True
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"MicroPython": ("https://docs.micropython.org/en/latest/", None),
}
# autodoc_mock_imports = ["digitalio", "busio"]
autoclass_content = "both"
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
source_suffix = ".rst"
master_doc = "index"
# General information about the project.
project = "MicroPython adt7410 Library"
creation_year = "2023"
current_year = str(datetime.datetime.now().year)
year_duration = (
current_year
if current_year == creation_year
else creation_year + " - " + current_year
)
copyright = year_duration + "Jose D. Montoya"
author = "Jose D. Montoya"
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = "1.0"
# The full version, including alpha/beta/rc tags.
release = "1.0"
language = "en"
autoclass_content = "both"
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = [
"_build",
"Thumbs.db",
".DS_Store",
".env",
"requirements.txt",
]
default_role = "any"
add_function_parentheses = True
pygments_style = "sphinx"
todo_include_todos = False
todo_emit_warnings = False
napoleon_numpy_docstring = False
html_baseurl = "https://micropython-adt7410.readthedocs.io/"
rst_prolog = """
.. role:: python(code)
:language: python
:class: highlight
.. default-literal-role:: python
"""
html_theme = "sphinx_immaterial"
html_theme_options = {
"features": [
"search.share",
],
# Set the color and the accent color
"palette": [
{
"media": "(prefers-color-scheme: light)",
"scheme": "default",
"primary": "purple",
"accent": "light-blue",
"toggle": {
"icon": "material/lightbulb-outline",
"name": "Switch to dark mode",
},
},
{
"media": "(prefers-color-scheme: dark)",
"scheme": "slate",
"primary": "purple",
"accent": "light-blue",
"toggle": {
"icon": "material/lightbulb",
"name": "Switch to light mode",
},
},
],
# Set the repo location to get a badge with stats
"repo_url": "https://github.com/jposada202020/MicroPython_ADT7410/",
"repo_name": "MicroPython ADT7410",
"social": [
{
"icon": "fontawesome/brands/github",
"link": "https://github.com/jposada202020/MicroPython_ADT7410",
},
{
"icon": "fontawesome/brands/python",
"link": "https://pypi.org/project/micropython-adt7410/",
},
{
"name": "MicroPython Downloads",
"icon": "octicons/download-24",
"link": "https://micropython.org",
},
],
}
html_favicon = "_static/favicon.ico"
# Output file base name for HTML help builder.
htmlhelp_basename = "MicroPython_Adt7410_Librarydoc"
sphinx_immaterial_custom_admonitions = [
{
"name": "warning",
"color": (255, 66, 66),
"icon": "octicons/alert-24",
"override": True,
},
{
"name": "note",
"icon": "octicons/pencil-24",
"override": True,
},
{
"name": "seealso",
"color": (255, 66, 252),
"icon": "octicons/eye-24",
"title": "See Also",
"override": True,
},
{
"name": "hint",
"icon": "material/school",
"override": True,
},
{
"name": "tip",
"icon": "material/school",
"override": True,
},
{
"name": "important",
"icon": "material/school",
"override": True,
},
]
object_description_options = [
("py:.*", dict(generate_synopses="first_sentence")),
]
# Set link name generated in the top bar.
html_title = "MicroPython ADT7410"
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
# These paths are either relative to html_static_path
# or fully qualified paths (eg. https://...)
html_css_files = ["extra_css.css"]