|
19 | 19 | # If extensions (or modules to document with autodoc) are in another directory,
|
20 | 20 | # add these directories to sys.path here. If the directory is relative to the
|
21 | 21 | # documentation root, use os.path.abspath to make it absolute, like shown here.
|
22 |
| -sys.path.insert(0, os.path.abspath('.')) |
| 22 | +sys.path.insert(0, os.path.abspath(".")) |
23 | 23 |
|
24 | 24 | # The MICROPY_VERSION env var should be "vX.Y.Z" (or unset).
|
25 |
| -micropy_version = os.getenv('MICROPY_VERSION') or 'latest' |
26 |
| -micropy_all_versions = (os.getenv('MICROPY_ALL_VERSIONS') or 'latest').split(',') |
27 |
| -url_pattern = '%s/en/%%s' % (os.getenv('MICROPY_URL_PREFIX') or '/',) |
| 25 | +micropy_version = os.getenv("MICROPY_VERSION") or "latest" |
| 26 | +micropy_all_versions = (os.getenv("MICROPY_ALL_VERSIONS") or "latest").split(",") |
| 27 | +url_pattern = "%s/en/%%s" % (os.getenv("MICROPY_URL_PREFIX") or "/",) |
28 | 28 |
|
29 | 29 | # The members of the html_context dict are available inside topindex.html
|
30 | 30 | html_context = {
|
31 |
| - 'cur_version':micropy_version, |
32 |
| - 'all_versions':[ |
33 |
| - (ver, url_pattern % ver) for ver in micropy_all_versions |
| 31 | + "cur_version": micropy_version, |
| 32 | + "all_versions": [(ver, url_pattern % ver) for ver in micropy_all_versions], |
| 33 | + "downloads": [ |
| 34 | + ("PDF", url_pattern % micropy_version + "/micropython-docs.pdf"), |
34 | 35 | ],
|
35 |
| - 'downloads':[ |
36 |
| - ('PDF', url_pattern % micropy_version + '/micropython-docs.pdf'), |
37 |
| - ], |
38 |
| - 'is_release': micropy_version != 'latest', |
| 36 | + "is_release": micropy_version != "latest", |
39 | 37 | }
|
40 | 38 |
|
41 | 39 |
|
42 | 40 | # -- General configuration ------------------------------------------------
|
43 | 41 |
|
44 | 42 | # If your documentation needs a minimal Sphinx version, state it here.
|
45 |
| -#needs_sphinx = '1.0' |
| 43 | +# needs_sphinx = '1.0' |
46 | 44 |
|
47 | 45 | # Add any Sphinx extension module names here, as strings. They can be
|
48 | 46 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
49 | 47 | # ones.
|
50 | 48 | extensions = [
|
51 |
| - 'sphinx.ext.autodoc', |
52 |
| - 'sphinx.ext.doctest', |
53 |
| - 'sphinx.ext.intersphinx', |
54 |
| - 'sphinx.ext.todo', |
55 |
| - 'sphinx.ext.coverage', |
56 |
| - 'sphinxcontrib.jquery', |
| 49 | + "sphinx.ext.autodoc", |
| 50 | + "sphinx.ext.doctest", |
| 51 | + "sphinx.ext.intersphinx", |
| 52 | + "sphinx.ext.todo", |
| 53 | + "sphinx.ext.coverage", |
| 54 | + "sphinxcontrib.jquery", |
57 | 55 | ]
|
58 | 56 |
|
59 | 57 | # Add any paths that contain templates here, relative to this directory.
|
60 |
| -templates_path = ['templates'] |
| 58 | +templates_path = ["templates"] |
61 | 59 |
|
62 | 60 | # The suffix of source filenames.
|
63 |
| -source_suffix = '.rst' |
| 61 | +source_suffix = ".rst" |
64 | 62 |
|
65 | 63 | # The encoding of source files.
|
66 |
| -#source_encoding = 'utf-8-sig' |
| 64 | +# source_encoding = 'utf-8-sig' |
67 | 65 |
|
68 | 66 | # The master toctree document.
|
69 |
| -master_doc = 'index' |
| 67 | +master_doc = "index" |
70 | 68 |
|
71 | 69 | # General information about the project.
|
72 |
| -project = 'MicroPython' |
73 |
| -copyright = '- The MicroPython Documentation is Copyright © 2014-2023, Damien P. George, Paul Sokolovsky, and contributors' |
| 70 | +project = "MicroPython" |
| 71 | +copyright = "- The MicroPython Documentation is Copyright © 2014-2023, Damien P. George, Paul Sokolovsky, and contributors" |
74 | 72 |
|
75 | 73 | # The version info for the project you're documenting, acts as replacement for
|
76 | 74 | # |version| and |release|, also used in various other places throughout the
|
|
82 | 80 |
|
83 | 81 | # The language for content autogenerated by Sphinx. Refer to documentation
|
84 | 82 | # for a list of supported languages.
|
85 |
| -#language = None |
| 83 | +# language = None |
86 | 84 |
|
87 | 85 | # There are two options for replacing |today|: either, you set today to some
|
88 | 86 | # non-false value, then it is used:
|
89 |
| -#today = '' |
| 87 | +# today = '' |
90 | 88 | # Else, today_fmt is used as the format for a strftime call.
|
91 |
| -#today_fmt = '%B %d, %Y' |
| 89 | +# today_fmt = '%B %d, %Y' |
92 | 90 |
|
93 | 91 | # List of patterns, relative to source directory, that match files and
|
94 | 92 | # directories to ignore when looking for source files.
|
95 |
| -exclude_patterns = ['build', '.venv'] |
| 93 | +exclude_patterns = ["build", ".venv"] |
96 | 94 |
|
97 | 95 | # The reST default role (used for this markup: `text`) to use for all
|
98 | 96 | # documents.
|
99 |
| -default_role = 'any' |
| 97 | +default_role = "any" |
100 | 98 |
|
101 | 99 | # If true, '()' will be appended to :func: etc. cross-reference text.
|
102 |
| -#add_function_parentheses = True |
| 100 | +# add_function_parentheses = True |
103 | 101 |
|
104 | 102 | # If true, the current module name will be prepended to all description
|
105 | 103 | # unit titles (such as .. function::).
|
106 |
| -#add_module_names = True |
| 104 | +# add_module_names = True |
107 | 105 |
|
108 | 106 | # If true, sectionauthor and moduleauthor directives will be shown in the
|
109 | 107 | # output. They are ignored by default.
|
110 |
| -#show_authors = False |
| 108 | +# show_authors = False |
111 | 109 |
|
112 | 110 | # The name of the Pygments (syntax highlighting) style to use.
|
113 |
| -pygments_style = 'sphinx' |
| 111 | +pygments_style = "sphinx" |
114 | 112 |
|
115 | 113 | # A list of ignored prefixes for module index sorting.
|
116 |
| -#modindex_common_prefix = [] |
| 114 | +# modindex_common_prefix = [] |
117 | 115 |
|
118 | 116 | # If true, keep warnings as "system message" paragraphs in the built documents.
|
119 |
| -#keep_warnings = False |
| 117 | +# keep_warnings = False |
120 | 118 |
|
121 | 119 | # Global include files. Sphinx docs suggest using rst_epilog in preference
|
122 | 120 | # of rst_prolog, so we follow. Absolute paths below mean "from the base
|
|
128 | 126 | # -- Options for HTML output ----------------------------------------------
|
129 | 127 |
|
130 | 128 | # on_rtd is whether we are on readthedocs.org
|
131 |
| -on_rtd = os.environ.get('READTHEDOCS', None) == 'True' |
| 129 | +on_rtd = os.environ.get("READTHEDOCS", None) == "True" |
132 | 130 |
|
133 | 131 | if not on_rtd: # only import and set the theme if we're building docs locally
|
134 | 132 | try:
|
135 | 133 | import sphinx_rtd_theme
|
136 |
| - html_theme = 'sphinx_rtd_theme' |
137 |
| - html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), '.'] |
| 134 | + |
| 135 | + html_theme = "sphinx_rtd_theme" |
| 136 | + html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."] |
138 | 137 | except:
|
139 |
| - html_theme = 'default' |
140 |
| - html_theme_path = ['.'] |
| 138 | + html_theme = "default" |
| 139 | + html_theme_path = ["."] |
141 | 140 | else:
|
142 |
| - html_theme_path = ['.'] |
| 141 | + html_theme_path = ["."] |
143 | 142 |
|
144 | 143 | # Theme options are theme-specific and customize the look and feel of a theme
|
145 | 144 | # further. For a list of options available for each theme, see the
|
146 | 145 | # documentation.
|
147 |
| -#html_theme_options = {} |
| 146 | +# html_theme_options = {} |
148 | 147 |
|
149 | 148 | # Add any paths that contain custom themes here, relative to this directory.
|
150 | 149 | # html_theme_path = ['.']
|
151 | 150 |
|
152 | 151 | # The name for this set of Sphinx documents. If None, it defaults to
|
153 | 152 | # "<project> v<release> documentation".
|
154 |
| -#html_title = None |
| 153 | +# html_title = None |
155 | 154 |
|
156 | 155 | # A shorter title for the navigation bar. Default is the same as html_title.
|
157 |
| -#html_short_title = None |
| 156 | +# html_short_title = None |
158 | 157 |
|
159 | 158 | # The name of an image file (relative to this directory) to place at the top
|
160 | 159 | # of the sidebar.
|
161 |
| -#html_logo = '../../logo/trans-logo.png' |
| 160 | +# html_logo = '../../logo/trans-logo.png' |
162 | 161 |
|
163 | 162 | # The name of an image file (within the static path) to use as favicon of the
|
164 | 163 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
165 | 164 | # pixels large.
|
166 |
| -html_favicon = 'static/favicon.ico' |
| 165 | +html_favicon = "static/favicon.ico" |
167 | 166 |
|
168 | 167 | # Add any paths that contain custom static files (such as style sheets) here,
|
169 | 168 | # relative to this directory. They are copied after the builtin static files,
|
170 | 169 | # so a file named "default.css" will overwrite the builtin "default.css".
|
171 |
| -html_static_path = ['static'] |
| 170 | +html_static_path = ["static"] |
172 | 171 |
|
173 | 172 | # Add a custom CSS file for HTML generation
|
174 | 173 | html_css_files = [
|
175 |
| - 'custom.css', |
| 174 | + "custom.css", |
176 | 175 | ]
|
177 | 176 | # Add any extra paths that contain custom files (such as robots.txt or
|
178 | 177 | # .htaccess) here, relative to this directory. These files are copied
|
179 | 178 | # directly to the root of the documentation.
|
180 |
| -#html_extra_path = [] |
| 179 | +# html_extra_path = [] |
181 | 180 |
|
182 | 181 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
183 | 182 | # using the given strftime format.
|
184 |
| -html_last_updated_fmt = '%d %b %Y' |
| 183 | +html_last_updated_fmt = "%d %b %Y" |
185 | 184 |
|
186 | 185 | # If true, SmartyPants will be used to convert quotes and dashes to
|
187 | 186 | # typographically correct entities.
|
188 |
| -#html_use_smartypants = True |
| 187 | +# html_use_smartypants = True |
189 | 188 |
|
190 | 189 | # Custom sidebar templates, maps document names to template names.
|
191 |
| -#html_sidebars = {} |
| 190 | +# html_sidebars = {} |
192 | 191 |
|
193 | 192 | # Additional templates that should be rendered to pages, maps page names to
|
194 | 193 | # template names.
|
195 | 194 | html_additional_pages = {"index": "topindex.html"}
|
196 | 195 |
|
197 | 196 | # If false, no module index is generated.
|
198 |
| -#html_domain_indices = True |
| 197 | +# html_domain_indices = True |
199 | 198 |
|
200 | 199 | # If false, no index is generated.
|
201 |
| -#html_use_index = True |
| 200 | +# html_use_index = True |
202 | 201 |
|
203 | 202 | # If true, the index is split into individual pages for each letter.
|
204 |
| -#html_split_index = False |
| 203 | +# html_split_index = False |
205 | 204 |
|
206 | 205 | # If true, links to the reST sources are added to the pages.
|
207 |
| -#html_show_sourcelink = True |
| 206 | +# html_show_sourcelink = True |
208 | 207 |
|
209 | 208 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
210 |
| -#html_show_sphinx = True |
| 209 | +# html_show_sphinx = True |
211 | 210 |
|
212 | 211 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
213 |
| -#html_show_copyright = True |
| 212 | +# html_show_copyright = True |
214 | 213 |
|
215 | 214 | # If true, an OpenSearch description file will be output, and all pages will
|
216 | 215 | # contain a <link> tag referring to it. The value of this option must be the
|
217 | 216 | # base URL from which the finished HTML is served.
|
218 |
| -#html_use_opensearch = '' |
| 217 | +# html_use_opensearch = '' |
219 | 218 |
|
220 | 219 | # This is the file name suffix for HTML files (e.g. ".xhtml").
|
221 |
| -#html_file_suffix = None |
| 220 | +# html_file_suffix = None |
222 | 221 |
|
223 | 222 | # Output file base name for HTML help builder.
|
224 |
| -htmlhelp_basename = 'MicroPythondoc' |
| 223 | +htmlhelp_basename = "MicroPythondoc" |
225 | 224 |
|
226 | 225 |
|
227 | 226 | # -- Options for LaTeX output ---------------------------------------------
|
228 | 227 |
|
229 | 228 | latex_elements = {
|
230 |
| -# The paper size ('letterpaper' or 'a4paper'). |
231 |
| -#'papersize': 'letterpaper', |
232 |
| - |
233 |
| -# The font size ('10pt', '11pt' or '12pt'). |
234 |
| -#'pointsize': '10pt', |
235 |
| - |
236 |
| -# Additional stuff for the LaTeX preamble. |
237 |
| -#'preamble': '', |
238 |
| -# Include 3 levels of headers in PDF ToC |
239 |
| -'preamble': r'\setcounter{tocdepth}{2}', |
| 229 | + # The paper size ('letterpaper' or 'a4paper'). |
| 230 | + #'papersize': 'letterpaper', |
| 231 | + # The font size ('10pt', '11pt' or '12pt'). |
| 232 | + #'pointsize': '10pt', |
| 233 | + # Additional stuff for the LaTeX preamble. |
| 234 | + #'preamble': '', |
| 235 | + # Include 3 levels of headers in PDF ToC |
| 236 | + "preamble": r"\setcounter{tocdepth}{2}", |
240 | 237 | }
|
241 | 238 |
|
242 | 239 | # Grouping the document tree into LaTeX files. List of tuples
|
243 | 240 | # (source start file, target name, title,
|
244 | 241 | # author, documentclass [howto, manual, or own class]).
|
245 | 242 | latex_documents = [
|
246 |
| - (master_doc, 'MicroPython.tex', 'MicroPython Documentation', |
247 |
| - 'Damien P. George, Paul Sokolovsky, and contributors', 'manual'), |
| 243 | + ( |
| 244 | + master_doc, |
| 245 | + "MicroPython.tex", |
| 246 | + "MicroPython Documentation", |
| 247 | + "Damien P. George, Paul Sokolovsky, and contributors", |
| 248 | + "manual", |
| 249 | + ), |
248 | 250 | ]
|
249 | 251 |
|
250 | 252 | # The name of an image file (relative to this directory) to place at the top of
|
251 | 253 | # the title page.
|
252 |
| -#latex_logo = None |
| 254 | +# latex_logo = None |
253 | 255 |
|
254 | 256 | # For "manual" documents, if this is true, then toplevel headings are parts,
|
255 | 257 | # not chapters.
|
256 |
| -#latex_use_parts = False |
| 258 | +# latex_use_parts = False |
257 | 259 |
|
258 | 260 | # If true, show page references after internal links.
|
259 |
| -#latex_show_pagerefs = False |
| 261 | +# latex_show_pagerefs = False |
260 | 262 |
|
261 | 263 | # If true, show URL addresses after external links.
|
262 |
| -#latex_show_urls = False |
| 264 | +# latex_show_urls = False |
263 | 265 |
|
264 | 266 | # Documents to append as an appendix to all manuals.
|
265 |
| -#latex_appendices = [] |
| 267 | +# latex_appendices = [] |
266 | 268 |
|
267 | 269 | # If false, no module index is generated.
|
268 |
| -#latex_domain_indices = True |
| 270 | +# latex_domain_indices = True |
269 | 271 |
|
270 | 272 | # Enable better Unicode support so that `make latexpdf` doesn't fail
|
271 | 273 | latex_engine = "xelatex"
|
|
275 | 277 | # One entry per manual page. List of tuples
|
276 | 278 | # (source start file, name, description, authors, manual section).
|
277 | 279 | man_pages = [
|
278 |
| - ('index', 'micropython', 'MicroPython Documentation', |
279 |
| - ['Damien P. George, Paul Sokolovsky, and contributors'], 1), |
| 280 | + ( |
| 281 | + "index", |
| 282 | + "micropython", |
| 283 | + "MicroPython Documentation", |
| 284 | + ["Damien P. George, Paul Sokolovsky, and contributors"], |
| 285 | + 1, |
| 286 | + ), |
280 | 287 | ]
|
281 | 288 |
|
282 | 289 | # If true, show URL addresses after external links.
|
283 |
| -#man_show_urls = False |
| 290 | +# man_show_urls = False |
284 | 291 |
|
285 | 292 |
|
286 | 293 | # -- Options for Texinfo output -------------------------------------------
|
|
289 | 296 | # (source start file, target name, title, author,
|
290 | 297 | # dir menu entry, description, category)
|
291 | 298 | texinfo_documents = [
|
292 |
| - (master_doc, 'MicroPython', 'MicroPython Documentation', |
293 |
| - 'Damien P. George, Paul Sokolovsky, and contributors', 'MicroPython', 'One line description of project.', |
294 |
| - 'Miscellaneous'), |
| 299 | + ( |
| 300 | + master_doc, |
| 301 | + "MicroPython", |
| 302 | + "MicroPython Documentation", |
| 303 | + "Damien P. George, Paul Sokolovsky, and contributors", |
| 304 | + "MicroPython", |
| 305 | + "One line description of project.", |
| 306 | + "Miscellaneous", |
| 307 | + ), |
295 | 308 | ]
|
296 | 309 |
|
297 | 310 | # Documents to append as an appendix to all manuals.
|
298 |
| -#texinfo_appendices = [] |
| 311 | +# texinfo_appendices = [] |
299 | 312 |
|
300 | 313 | # If false, no module index is generated.
|
301 |
| -#texinfo_domain_indices = True |
| 314 | +# texinfo_domain_indices = True |
302 | 315 |
|
303 | 316 | # How to display URL addresses: 'footnote', 'no', or 'inline'.
|
304 |
| -#texinfo_show_urls = 'footnote' |
| 317 | +# texinfo_show_urls = 'footnote' |
305 | 318 |
|
306 | 319 | # If true, do not generate a @detailmenu in the "Top" node's menu.
|
307 |
| -#texinfo_no_detailmenu = False |
| 320 | +# texinfo_no_detailmenu = False |
308 | 321 |
|
309 | 322 |
|
310 | 323 | # Example configuration for intersphinx: refer to the Python standard library.
|
311 |
| -intersphinx_mapping = {'python': ('https://docs.python.org/3.5', None)} |
| 324 | +intersphinx_mapping = {"python": ("https://docs.python.org/3.5", None)} |
0 commit comments