Skip to content

Commit be6db46

Browse files
authored
Merge pull request #125 from dhalbert/fix-class-docs
update conf.py; fix indentations in constructor docstrings
2 parents 01610da + effaab2 commit be6db46

File tree

4 files changed

+26
-13
lines changed

4 files changed

+26
-13
lines changed

adafruit_hid/consumer_control.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def __init__(self, devices: Sequence[usb_hid.Device], timeout: int = None) -> No
3434
"""Create a ConsumerControl object that will send Consumer Control Device HID reports.
3535
3636
:param timeout: Time in seconds to wait for USB to become ready before timing out.
37-
Defaults to None to wait indefinitely.
37+
Defaults to None to wait indefinitely.
3838
3939
Devices can be a sequence of devices that includes a Consumer Control device or a CC device
4040
itself. A device is any object that implements ``send_report()``, ``usage_page`` and

adafruit_hid/keyboard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __init__(self, devices: Sequence[usb_hid.Device], timeout: int = None) -> No
4242
"""Create a Keyboard object that will send keyboard HID reports.
4343
4444
:param timeout: Time in seconds to wait for USB to become ready before timing out.
45-
Defaults to None to wait indefinitely.
45+
Defaults to None to wait indefinitely.
4646
4747
Devices can be a sequence of devices that includes a keyboard device or a keyboard device
4848
itself. A device is any object that implements ``send_report()``, ``usage_page`` and

adafruit_hid/mouse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def __init__(self, devices: Sequence[usb_hid.Device], timeout: int = None) -> No
3535
"""Create a Mouse object that will send USB mouse HID reports.
3636
3737
:param timeout: Time in seconds to wait for USB to become ready before timing out.
38-
Defaults to None to wait indefinitely.
38+
Defaults to None to wait indefinitely.
3939
4040
Devices can be a sequence of devices that includes a keyboard device or a keyboard device
4141
itself. A device is any object that implements ``send_report()``, ``usage_page`` and

docs/conf.py

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
3+
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
44
#
55
# SPDX-License-Identifier: MIT
66

@@ -19,14 +19,27 @@
1919
"sphinx.ext.autodoc",
2020
"sphinxcontrib.jquery",
2121
"sphinx.ext.intersphinx",
22-
"sphinx.ext.viewcode",
22+
"sphinx.ext.napoleon",
23+
"sphinx.ext.todo",
2324
]
2425

26+
# TODO: Please Read!
27+
# Uncomment the below if you use native CircuitPython modules such as
28+
# digitalio, micropython and busio. List the modules you use. Without it, the
29+
# autodoc module docs will fail to generate with a warning.
30+
autodoc_mock_imports = ["usb_hid"]
31+
32+
autodoc_preserve_defaults = True
33+
34+
2535
intersphinx_mapping = {
2636
"python": ("https://docs.python.org/3", None),
2737
"CircuitPython": ("https://docs.circuitpython.org/en/latest/", None),
2838
}
2939

40+
# Show the docstring from both the class and its __init__() method.
41+
autoclass_content = "both"
42+
3043
# Add any paths that contain templates here, relative to this directory.
3144
templates_path = ["_templates"]
3245

@@ -47,9 +60,6 @@
4760
copyright = year_duration + " Scott Shawcroft"
4861
author = "Scott Shawcroft"
4962

50-
# Ignore imports of these modules, which sphinx will not know about.
51-
autodoc_mock_imports = ["usb_hid"]
52-
5363
# The version info for the project you're documenting, acts as replacement for
5464
# |version| and |release|, also used in various other places throughout the
5565
# built documents.
@@ -69,7 +79,13 @@
6979
# List of patterns, relative to source directory, that match files and
7080
# directories to ignore when looking for source files.
7181
# This patterns also effect to html_static_path and html_extra_path
72-
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", ".env", "CODE_OF_CONDUCT.md"]
82+
exclude_patterns = [
83+
"_build",
84+
"Thumbs.db",
85+
".DS_Store",
86+
".env",
87+
"CODE_OF_CONDUCT.md",
88+
]
7389

7490
# The reST default role (used for this markup: `text`) to use for all
7591
# documents.
@@ -89,6 +105,7 @@
89105
# If this is True, todo emits a warning for each TODO entries. The default is False.
90106
todo_emit_warnings = True
91107

108+
napoleon_numpy_docstring = False
92109

93110
# -- Options for HTML output ----------------------------------------------
94111

@@ -118,16 +135,12 @@
118135

119136
latex_elements = {
120137
# The paper size ('letterpaper' or 'a4paper').
121-
#
122138
# 'papersize': 'letterpaper',
123139
# The font size ('10pt', '11pt' or '12pt').
124-
#
125140
# 'pointsize': '10pt',
126141
# Additional stuff for the LaTeX preamble.
127-
#
128142
# 'preamble': '',
129143
# Latex figure (float) alignment
130-
#
131144
# 'figure_align': 'htbp',
132145
}
133146

0 commit comments

Comments
 (0)