Skip to content

Commit b96dcf2

Browse files
committed
update docs conf
1 parent 7d1055b commit b96dcf2

File tree

1 file changed

+36
-243
lines changed

1 file changed

+36
-243
lines changed

docs/conf.py

Lines changed: 36 additions & 243 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,7 @@
11
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
22
#
33
# SPDX-License-Identifier: MIT
4-
#
5-
# Adafruit AMG88xx Library documentation build configuration file, created by
6-
# sphinx-quickstart on Fri Nov 11 07:42:21 2016.
7-
#
8-
# This file is execfile()d with the current directory set to its
9-
# containing dir.
10-
#
11-
# Note that not all possible configuration values are present in this
12-
# autogenerated file.
13-
#
14-
# All configuration values have a default; values that are commented out
15-
# serve to show the default.
164

17-
# If extensions (or modules to document with autodoc) are in another directory,
18-
# add these directories to sys.path here. If the directory is relative to the
19-
# documentation root, use os.path.abspath to make it absolute, like shown here.
20-
#
215
import datetime
226
import os
237
import sys
@@ -26,38 +10,40 @@
2610

2711
# -- General configuration ------------------------------------------------
2812

29-
# If your documentation needs a minimal Sphinx version, state it here.
30-
#
31-
# needs_sphinx = '1.0'
32-
3313
# Add any Sphinx extension module names here, as strings. They can be
3414
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3515
# ones.
3616
extensions = [
3717
"sphinx.ext.autodoc",
3818
"sphinxcontrib.jquery",
3919
"sphinx.ext.intersphinx",
40-
"sphinx.ext.viewcode",
20+
"sphinx.ext.napoleon",
21+
"sphinx.ext.todo",
4122
]
4223

24+
# TODO: Please Read!
4325
# Uncomment the below if you use native CircuitPython modules such as
4426
# digitalio, micropython and busio. List the modules you use. Without it, the
4527
# autodoc module docs will fail to generate with a warning.
46-
# autodoc_mock_imports = ["adafruit_bus_device", "micropython", "adafruit_register"]
28+
# autodoc_mock_imports = ["digitalio", "busio"]
29+
30+
autodoc_preserve_defaults = True
31+
32+
33+
intersphinx_mapping = {
34+
"python": ("https://docs.python.org/3", None),
35+
"BusDevice": ("https://docs.circuitpython.org/projects/busdevice/en/latest/", None),
36+
"CircuitPython": ("https://docs.circuitpython.org/en/latest/", None),
37+
}
38+
39+
# Show the docstring from both the class and its __init__() method.
40+
autoclass_content = "both"
4741

4842
# Add any paths that contain templates here, relative to this directory.
4943
templates_path = ["_templates"]
5044

51-
# The suffix(es) of source filenames.
52-
# You can specify multiple suffix as a list of string:
53-
#
54-
# source_suffix = ['.rst', '.md']
5545
source_suffix = ".rst"
5646

57-
# The encoding of source files.
58-
#
59-
# source_encoding = 'utf-8-sig'
60-
6147
# The master toctree document.
6248
master_doc = "index"
6349

@@ -87,19 +73,16 @@
8773
# Usually you set "language" from the command line for these cases.
8874
language = "en"
8975

90-
# There are two options for replacing |today|: either, you set today to some
91-
# non-false value, then it is used:
92-
#
93-
# today = ''
94-
#
95-
# Else, today_fmt is used as the format for a strftime call.
96-
#
97-
# today_fmt = '%B %d, %Y'
98-
9976
# List of patterns, relative to source directory, that match files and
10077
# directories to ignore when looking for source files.
10178
# This patterns also effect to html_static_path and html_extra_path
102-
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", ".env", "CODE_OF_CONDUCT.md"]
79+
exclude_patterns = [
80+
"_build",
81+
"Thumbs.db",
82+
".DS_Store",
83+
".env",
84+
"CODE_OF_CONDUCT.md",
85+
]
10386

10487
# The reST default role (used for this markup: `text`) to use for all
10588
# documents.
@@ -108,17 +91,7 @@
10891

10992
# If true, '()' will be appended to :func: etc. cross-reference text.
11093
#
111-
# add_function_parentheses = True
112-
113-
# If true, the current module name will be prepended to all description
114-
# unit titles (such as .. function::).
115-
#
116-
# add_module_names = True
117-
118-
# If true, sectionauthor and moduleauthor directives will be shown in the
119-
# output. They are ignored by default.
120-
#
121-
# show_authors = False
94+
add_function_parentheses = True
12295

12396
# The name of the Pygments (syntax highlighting) style to use.
12497
pygments_style = "sphinx"
@@ -129,162 +102,41 @@
129102
# If this is True, todo emits a warning for each TODO entries. The default is False.
130103
todo_emit_warnings = True
131104

132-
# A list of ignored prefixes for module index sorting.
133-
# modindex_common_prefix = []
134-
135-
# If true, keep warnings as "system message" paragraphs in the built documents.
136-
# keep_warnings = False
137-
138-
# If true, `todo` and `todoList` produce output, else they produce nothing.
139-
todo_include_todos = False
140-
105+
napoleon_numpy_docstring = False
141106

142107
# -- Options for HTML output ----------------------------------------------
143108

144109
# The theme to use for HTML and HTML Help pages. See the documentation for
145110
# a list of builtin themes.
146111
#
147-
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
148-
149-
if not on_rtd: # only import and set the theme if we're building docs locally
150-
try:
151-
import sphinx_rtd_theme
152-
153-
html_theme = "sphinx_rtd_theme"
154-
except ImportError:
155-
html_theme = "default"
156-
html_theme_path = ["."]
157-
else:
158-
html_theme_path = ["."]
159-
160-
# Theme options are theme-specific and customize the look and feel of a theme
161-
# further. For a list of options available for each theme, see the
162-
# documentation.
163-
#
164-
# html_theme_options = {}
165-
166-
# Add any paths that contain custom themes here, relative to this directory.
167-
# html_theme_path = []
168-
169-
# The name for this set of Sphinx documents.
170-
# "<project> v<release> documentation" by default.
171-
#
172-
# html_title = u'Adafruit AMG88xx Library v1.0'
173-
174-
# A shorter title for the navigation bar. Default is the same as html_title.
175-
#
176-
# html_short_title = None
112+
import sphinx_rtd_theme
177113

178-
# The name of an image file (relative to this directory) to place at the top
179-
# of the sidebar.
180-
#
181-
# html_logo = None
182-
183-
# The name of an image file (relative to this directory) to use as a favicon of
184-
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
185-
# pixels large.
186-
#
187-
# html_favicon = None
114+
html_theme = "sphinx_rtd_theme"
188115

189116
# Add any paths that contain custom static files (such as style sheets) here,
190117
# relative to this directory. They are copied after the builtin static files,
191118
# so a file named "default.css" will overwrite the builtin "default.css".
192119
html_static_path = ["_static"]
193120

194-
# Add any extra paths that contain custom files (such as robots.txt or
195-
# .htaccess) here, relative to this directory. These files are copied
196-
# directly to the root of the documentation.
197-
#
198-
# html_extra_path = []
199-
200-
# If not None, a 'Last updated on:' timestamp is inserted at every page
201-
# bottom, using the given strftime format.
202-
# The empty string is equivalent to '%b %d, %Y'.
203-
#
204-
# html_last_updated_fmt = None
205-
206-
# If true, SmartyPants will be used to convert quotes and dashes to
207-
# typographically correct entities.
208-
#
209-
# html_use_smartypants = True
210-
211-
# Custom sidebar templates, maps document names to template names.
212-
#
213-
# html_sidebars = {}
214-
215-
# Additional templates that should be rendered to pages, maps page names to
216-
# template names.
217-
#
218-
# html_additional_pages = {}
219-
220-
# If false, no module index is generated.
221-
#
222-
# html_domain_indices = True
223-
224-
# If false, no index is generated.
225-
#
226-
# html_use_index = True
227-
228-
# If true, the index is split into individual pages for each letter.
229-
#
230-
# html_split_index = False
231-
232-
# If true, links to the reST sources are added to the pages.
233-
#
234-
# html_show_sourcelink = True
235-
236-
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
237-
#
238-
# html_show_sphinx = True
239-
240-
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
241-
#
242-
# html_show_copyright = True
243-
244-
# If true, an OpenSearch description file will be output, and all pages will
245-
# contain a <link> tag referring to it. The value of this option must be the
246-
# base URL from which the finished HTML is served.
247-
#
248-
# html_use_opensearch = ''
249-
250-
# This is the file name suffix for HTML files (e.g. ".xhtml").
251-
# html_file_suffix = None
252-
253-
# Language to be used for generating the HTML full-text search index.
254-
# Sphinx supports the following languages:
255-
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
256-
# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh'
257-
#
258-
# html_search_language = 'en'
259-
260-
# A dictionary with options for the search language support, empty by default.
261-
# 'ja' uses this config value.
262-
# 'zh' user can custom change `jieba` dictionary path.
263-
#
264-
# html_search_options = {'type': 'default'}
265-
266-
# The name of a javascript file (relative to the configuration directory) that
267-
# implements a search results scorer. If empty, the default will be used.
121+
# The name of an image file (relative to this directory) to use as a favicon of
122+
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
123+
# pixels large.
268124
#
269-
# html_search_scorer = 'scorer.js'
125+
html_favicon = "_static/favicon.ico"
270126

271127
# Output file base name for HTML help builder.
272-
htmlhelp_basename = "AdafruitAMG88xxLibrarydoc"
128+
htmlhelp_basename = "Adafruit_CircuitPython_AMG8xx_Librarydoc"
273129

274130
# -- Options for LaTeX output ---------------------------------------------
275131

276132
latex_elements = {
277133
# The paper size ('letterpaper' or 'a4paper').
278-
#
279134
# 'papersize': 'letterpaper',
280135
# The font size ('10pt', '11pt' or '12pt').
281-
#
282136
# 'pointsize': '10pt',
283137
# Additional stuff for the LaTeX preamble.
284-
#
285138
# 'preamble': '',
286139
# Latex figure (float) alignment
287-
#
288140
# 'figure_align': 'htbp',
289141
}
290142

@@ -294,46 +146,13 @@
294146
latex_documents = [
295147
(
296148
master_doc,
297-
"AdafruitAMG88xxLibrary.tex",
298-
"Adafruit AMG88xx Library Documentation",
299-
"Dean Miller",
149+
"Adafruit_CircuitPython_AMG88xx_Library.tex",
150+
"Adafruit CircuitPython AMG88xx Library Documentation",
151+
author,
300152
"manual",
301153
),
302154
]
303155

304-
# The name of an image file (relative to this directory) to place at the top of
305-
# the title page.
306-
#
307-
# latex_logo = None
308-
309-
# For "manual" documents, if this is true, then toplevel headings are parts,
310-
# not chapters.
311-
#
312-
# latex_use_parts = False
313-
314-
# If true, show page references after internal links.
315-
#
316-
# latex_show_pagerefs = False
317-
318-
# If true, show URL addresses after external links.
319-
#
320-
# latex_show_urls = False
321-
322-
# Documents to append as an appendix to all manuals.
323-
#
324-
# latex_appendices = []
325-
326-
# It false, will not define \strong, \code, itleref, \crossref ... but only
327-
# \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added
328-
# packages.
329-
#
330-
# latex_keep_old_macro_names = True
331-
332-
# If false, no module index is generated.
333-
#
334-
# latex_domain_indices = True
335-
336-
337156
# -- Options for manual page output ---------------------------------------
338157

339158
# One entry per manual page. List of tuples
@@ -345,14 +164,9 @@
345164
"Adafruit AMG88xx Library Documentation",
346165
[author],
347166
1,
348-
)
167+
),
349168
]
350169

351-
# If true, show URL addresses after external links.
352-
#
353-
# man_show_urls = False
354-
355-
356170
# -- Options for Texinfo output -------------------------------------------
357171

358172
# Grouping the document tree into Texinfo files. List of tuples
@@ -369,24 +183,3 @@
369183
"Miscellaneous",
370184
),
371185
]
372-
373-
# Documents to append as an appendix to all manuals.
374-
#
375-
# texinfo_appendices = []
376-
377-
# If false, no module index is generated.
378-
#
379-
# texinfo_domain_indices = True
380-
381-
# How to display URL addresses: 'footnote', 'no', or 'inline'.
382-
#
383-
# texinfo_show_urls = 'footnote'
384-
385-
# If true, do not generate a @detailmenu in the "Top" node's menu.
386-
#
387-
# texinfo_no_detailmenu = False
388-
389-
intersphinx_mapping = {
390-
"python": ("https://docs.python.org/3", None),
391-
"CircuitPython": ("https://docs.circuitpython.org/en/latest/", None),
392-
}

0 commit comments

Comments
 (0)