Skip to content

Commit 06af56c

Browse files
authored
Merge pull request #9 from adafruit/use_ruff
update docs conf
2 parents 6badd48 + 89b241e commit 06af56c

File tree

1 file changed

+31
-220
lines changed

1 file changed

+31
-220
lines changed

docs/conf.py

Lines changed: 31 additions & 220 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,36 @@
1010

1111
# -- General configuration ------------------------------------------------
1212

13-
# If your documentation needs a minimal Sphinx version, state it here.
14-
#
15-
# needs_sphinx = '1.0'
16-
1713
# Add any Sphinx extension module names here, as strings. They can be
1814
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
1915
# ones.
2016
extensions = [
2117
"sphinx.ext.autodoc",
2218
"sphinxcontrib.jquery",
23-
"sphinx.ext.todo",
2419
"sphinx.ext.intersphinx",
20+
"sphinx.ext.napoleon",
21+
"sphinx.ext.todo",
2522
]
2623

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

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+
3239
# Add any paths that contain templates here, relative to this directory.
3340
templates_path = ["_templates"]
3441

35-
# The suffix(es) of source filenames.
36-
# You can specify multiple suffix as a list of string:
37-
#
38-
source_suffix = [".rst", ".md"]
39-
# source_suffix = '.rst'
40-
41-
# The encoding of source files.
42-
#
43-
# source_encoding = 'utf-8-sig'
42+
source_suffix = ".rst"
4443

4544
# The master toctree document.
4645
master_doc = "index"
@@ -71,19 +70,16 @@
7170
# Usually you set "language" from the command line for these cases.
7271
language = "en"
7372

74-
# There are two options for replacing |today|: either, you set today to some
75-
# non-false value, then it is used:
76-
#
77-
# today = ''
78-
#
79-
# Else, today_fmt is used as the format for a strftime call.
80-
#
81-
# today_fmt = '%B %d, %Y'
82-
8373
# List of patterns, relative to source directory, that match files and
8474
# directories to ignore when looking for source files.
8575
# This patterns also effect to html_static_path and html_extra_path
86-
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+
]
8783

8884
# The reST default role (used for this markup: `text`) to use for all
8985
# documents.
@@ -92,178 +88,52 @@
9288

9389
# If true, '()' will be appended to :func: etc. cross-reference text.
9490
#
95-
# add_function_parentheses = True
96-
97-
# If true, the current module name will be prepended to all description
98-
# unit titles (such as .. function::).
99-
#
100-
# add_module_names = True
101-
102-
# If true, sectionauthor and moduleauthor directives will be shown in the
103-
# output. They are ignored by default.
104-
#
105-
# show_authors = False
91+
add_function_parentheses = True
10692

10793
# The name of the Pygments (syntax highlighting) style to use.
10894
pygments_style = "sphinx"
10995

110-
# A list of ignored prefixes for module index sorting.
111-
# modindex_common_prefix = []
112-
113-
# If true, keep warnings as "system message" paragraphs in the built documents.
114-
# keep_warnings = False
115-
11696
# If true, `todo` and `todoList` produce output, else they produce nothing.
11797
todo_include_todos = False
11898

11999
# If this is True, todo emits a warning for each TODO entries. The default is False.
120100
todo_emit_warnings = True
121101

102+
napoleon_numpy_docstring = False
103+
122104
# -- Options for HTML output ----------------------------------------------
123105

124106
# The theme to use for HTML and HTML Help pages. See the documentation for
125107
# a list of builtin themes.
126108
#
127-
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
128-
129-
if not on_rtd: # only import and set the theme if we're building docs locally
130-
try:
131-
import sphinx_rtd_theme
132-
133-
html_theme = "sphinx_rtd_theme"
134-
except ImportError:
135-
html_theme = "default"
136-
html_theme_path = ["."]
137-
else:
138-
html_theme_path = ["."]
139-
140-
# Theme options are theme-specific and customize the look and feel of a theme
141-
# further. For a list of options available for each theme, see the
142-
# documentation.
143-
#
144-
# html_theme_options = {}
109+
import sphinx_rtd_theme
145110

146-
# Add any paths that contain custom themes here, relative to this directory.
147-
# html_theme_path = []
148-
149-
# The name for this set of Sphinx documents.
150-
# "<project> v<release> documentation" by default.
151-
#
152-
# html_title = u'Adafruit PCF8563 RTC Library v1.0'
153-
154-
# A shorter title for the navigation bar. Default is the same as html_title.
155-
#
156-
# html_short_title = None
157-
158-
# The name of an image file (relative to this directory) to place at the top
159-
# of the sidebar.
160-
#
161-
# html_logo = None
162-
163-
# The name of an image file (within the static path) to use as favicon of the
164-
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
165-
# pixels large.
166-
html_favicon = "_static/favicon.ico"
111+
html_theme = "sphinx_rtd_theme"
167112

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

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

250124
# Output file base name for HTML help builder.
251-
# htmlhelp_basename = 'AdafruitsPCF8563RTCLibrarydoc'
125+
htmlhelp_basename = "AdafruitsPCF8563RTCLibrarydoc"
252126

253127
# -- Options for LaTeX output ---------------------------------------------
254128

255129
latex_elements = {
256130
# The paper size ('letterpaper' or 'a4paper').
257-
#
258131
# 'papersize': 'letterpaper',
259132
# The font size ('10pt', '11pt' or '12pt').
260-
#
261133
# 'pointsize': '10pt',
262134
# Additional stuff for the LaTeX preamble.
263-
#
264135
# 'preamble': '',
265136
# Latex figure (float) alignment
266-
#
267137
# 'figure_align': 'htbp',
268138
}
269139

@@ -280,39 +150,6 @@
280150
),
281151
]
282152

283-
# The name of an image file (relative to this directory) to place at the top of
284-
# the title page.
285-
#
286-
# latex_logo = None
287-
288-
# For "manual" documents, if this is true, then toplevel headings are parts,
289-
# not chapters.
290-
#
291-
# latex_use_parts = False
292-
293-
# If true, show page references after internal links.
294-
#
295-
# latex_show_pagerefs = False
296-
297-
# If true, show URL addresses after external links.
298-
#
299-
# latex_show_urls = False
300-
301-
# Documents to append as an appendix to all manuals.
302-
#
303-
# latex_appendices = []
304-
305-
# It false, will not define \strong, \code, itleref, \crossref ... but only
306-
# \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added
307-
# packages.
308-
#
309-
# latex_keep_old_macro_names = True
310-
311-
# If false, no module index is generated.
312-
#
313-
# latex_domain_indices = True
314-
315-
316153
# -- Options for manual page output ---------------------------------------
317154

318155
# One entry per manual page. List of tuples
@@ -324,14 +161,9 @@
324161
"Adafruit PCF8563 RTC Library Documentation",
325162
[author],
326163
1,
327-
)
164+
),
328165
]
329166

330-
# If true, show URL addresses after external links.
331-
#
332-
# man_show_urls = False
333-
334-
335167
# -- Options for Texinfo output -------------------------------------------
336168

337169
# Grouping the document tree into Texinfo files. List of tuples
@@ -348,24 +180,3 @@
348180
"Miscellaneous",
349181
),
350182
]
351-
352-
# Documents to append as an appendix to all manuals.
353-
#
354-
# texinfo_appendices = []
355-
356-
# If false, no module index is generated.
357-
#
358-
# texinfo_domain_indices = True
359-
360-
# How to display URL addresses: 'footnote', 'no', or 'inline'.
361-
#
362-
# texinfo_show_urls = 'footnote'
363-
364-
# If true, do not generate a @detailmenu in the "Top" node's menu.
365-
#
366-
# texinfo_no_detailmenu = False
367-
368-
intersphinx_mapping = {
369-
"python": ("https://docs.python.org/3", None),
370-
"CircuitPython": ("https://docs.circuitpython.org/en/latest/", None),
371-
}

0 commit comments

Comments
 (0)