Skip to content

Commit 33a7ade

Browse files
committed
try to get sphinx docs to build
1 parent 7b8a853 commit 33a7ade

File tree

4 files changed

+20
-16
lines changed

4 files changed

+20
-16
lines changed

README.rst

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@ or individual libraries can be installed using
3737
`circup <https://github.com/adafruit/circup>`_.
3838

3939

40-
41-
.. todo:: Describe the Adafruit product this library works with. For PCBs, you can also add the
42-
image from the assets folder in the PCB's GitHub repo.
43-
44-
`Purchase one from the Adafruit shop <http://www.adafruit.com/products/>`_
45-
4640
Installing from PyPI
4741
=====================
4842

@@ -95,8 +89,23 @@ Or the following command to update an existing version:
9589
Usage Example
9690
=============
9791

98-
.. todo:: Add a quick, simple example. It and other examples should live in the
99-
examples folder and be included in docs/examples.rst.
92+
.. code-block:: python
93+
94+
import adafruit_midi
95+
import adafruit_usb_host_midi
96+
97+
print("Looking for midi device")
98+
raw_midi = None
99+
while raw_midi is None:
100+
for device in usb.core.find(find_all=True):
101+
try:
102+
raw_midi = adafruit_usb_host_midi.MIDI(device)
103+
print("Found", hex(device.idVendor), hex(device.idProduct))
104+
except ValueError:
105+
continue
106+
107+
midi_device = adafruit_midi.MIDI(midi_in=raw_midi, in_channel=0)
108+
100109
101110
Documentation
102111
=============

adafruit_usb_host_midi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323

2424
class MIDI:
2525
"""
26-
Stream-like MIDI device for use with `adafruit_midi` and similar upstream
26+
Stream-like MIDI device for use with ``adafruit_midi`` and similar upstream
2727
MIDI parser libraries.
2828
29-
:param device: a ``usb.core.Device` object which implements
29+
:param device: a ``usb.core.Device`` object which implements
3030
``read(endpoint, buffer)`` and ``write(endpoint,buffer)``
3131
:param float timeout: timeout in seconds to wait for read or write operation
3232
to succeeds. Default to None, i.e. reads and writes will block.

docs/index.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,9 @@ Table of Contents
2424
.. toctree::
2525
:caption: Tutorials
2626

27-
.. todo:: Add any Learn guide links here. If there are none, then simply delete this todo and leave
28-
the toctree above for use later.
29-
3027
.. toctree::
3128
:caption: Related Products
3229

33-
.. todo:: Add any product links here. If there are none, then simply delete this todo and leave
34-
the toctree above for use later.
35-
3630
.. toctree::
3731
:caption: Other Links
3832

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
# SPDX-License-Identifier: MIT
55

66
Adafruit-Blinka
7+
pyusb

0 commit comments

Comments
 (0)