Skip to content

Commit 63cc2f8

Browse files
committed
update docs conf
1 parent 7c936e4 commit 63cc2f8

File tree

1 file changed

+24
-236
lines changed

1 file changed

+24
-236
lines changed

docs/conf.py

Lines changed: 24 additions & 236 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 DS1307 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,37 +10,37 @@
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",
18+
"sphinxcontrib.jquery",
3819
"sphinx.ext.intersphinx",
39-
"sphinx.ext.viewcode",
20+
"sphinx.ext.napoleon",
21+
"sphinx.ext.todo",
4022
]
4123

24+
# TODO: Please Read!
4225
# Uncomment the below if you use native CircuitPython modules such as
4326
# digitalio, micropython and busio. List the modules you use. Without it, the
4427
# autodoc module docs will fail to generate with a warning.
4528
# autodoc_mock_imports = ["adafruit_register", "adafruit_bus_device"]
4629

30+
31+
intersphinx_mapping = {
32+
"python": ("https://docs.python.org/3", None),
33+
"CircuitPython": ("https://docs.circuitpython.org/en/latest/", None),
34+
}
35+
36+
# Show the docstring from both the class and its __init__() method.
37+
autoclass_content = "both"
38+
4739
# Add any paths that contain templates here, relative to this directory.
4840
templates_path = ["_templates"]
4941

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

56-
# The encoding of source files.
57-
#
58-
# source_encoding = 'utf-8-sig'
59-
6044
# The master toctree document.
6145
master_doc = "index"
6246

@@ -86,19 +70,16 @@
8670
# Usually you set "language" from the command line for these cases.
8771
language = "en"
8872

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

10384
# The reST default role (used for this markup: `text`) to use for all
10485
# documents.
@@ -109,78 +90,25 @@
10990
#
11091
add_function_parentheses = True
11192

112-
# If true, the current module name will be prepended to all description
113-
# unit titles (such as .. function::).
114-
#
115-
# add_module_names = True
116-
117-
# If true, sectionauthor and moduleauthor directives will be shown in the
118-
# output. They are ignored by default.
119-
#
120-
# show_authors = False
121-
12293
# The name of the Pygments (syntax highlighting) style to use.
12394
pygments_style = "sphinx"
12495

125-
# A list of ignored prefixes for module index sorting.
126-
# modindex_common_prefix = []
127-
128-
# If true, keep warnings as "system message" paragraphs in the built documents.
129-
# keep_warnings = False
130-
13196
# If true, `todo` and `todoList` produce output, else they produce nothing.
13297
todo_include_todos = False
13398

13499
# If this is True, todo emits a warning for each TODO entries. The default is False.
135100
todo_emit_warnings = True
136101

102+
napoleon_numpy_docstring = False
137103

138104
# -- Options for HTML output ----------------------------------------------
139105

140106
# The theme to use for HTML and HTML Help pages. See the documentation for
141107
# a list of builtin themes.
142108
#
143-
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
144-
145-
if not on_rtd: # only import and set the theme if we're building docs locally
146-
try:
147-
import sphinx_rtd_theme
148-
149-
html_theme = "sphinx_rtd_theme"
150-
except ImportError:
151-
html_theme = "default"
152-
html_theme_path = ["."]
153-
else:
154-
html_theme_path = ["."]
155-
156-
# Theme options are theme-specific and customize the look and feel of a theme
157-
# further. For a list of options available for each theme, see the
158-
# documentation.
159-
#
160-
# html_theme_options = {}
161-
162-
# Add any paths that contain custom themes here, relative to this directory.
163-
# html_theme_path = []
109+
import sphinx_rtd_theme
164110

165-
# The name for this set of Sphinx documents.
166-
# "<project> v<release> documentation" by default.
167-
#
168-
# html_title = u'Adafruit DS1307 Library v1.0'
169-
170-
# A shorter title for the navigation bar. Default is the same as html_title.
171-
#
172-
# html_short_title = None
173-
174-
# The name of an image file (relative to this directory) to place at the top
175-
# of the sidebar.
176-
#
177-
# html_logo = None
178-
179-
# The name of an image file (relative to this directory) to use as a favicon of
180-
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
181-
# pixels large.
182-
#
183-
# html_favicon = None
111+
html_theme = "sphinx_rtd_theme"
184112

185113
# Add any paths that contain custom static files (such as style sheets) here,
186114
# relative to this directory. They are copied after the builtin static files,
@@ -193,100 +121,19 @@
193121
#
194122
html_favicon = "_static/favicon.ico"
195123

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

276127
# -- Options for LaTeX output ---------------------------------------------
277128

278129
latex_elements = {
279130
# The paper size ('letterpaper' or 'a4paper').
280-
#
281131
# 'papersize': 'letterpaper',
282132
# The font size ('10pt', '11pt' or '12pt').
283-
#
284133
# 'pointsize': '10pt',
285134
# Additional stuff for the LaTeX preamble.
286-
#
287135
# 'preamble': '',
288136
# Latex figure (float) alignment
289-
#
290137
# 'figure_align': 'htbp',
291138
}
292139

@@ -303,39 +150,6 @@
303150
),
304151
]
305152

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

341155
# One entry per manual page. List of tuples
@@ -347,14 +161,9 @@
347161
"Adafruit DS1307 Library Documentation",
348162
[author],
349163
1,
350-
)
164+
),
351165
]
352166

353-
# If true, show URL addresses after external links.
354-
#
355-
# man_show_urls = False
356-
357-
358167
# -- Options for Texinfo output -------------------------------------------
359168

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

0 commit comments

Comments
 (0)