Skip to content

Commit 79516d6

Browse files
authored
Merge pull request #5 from sommersoft/new_docs
Improve Ref Docs
2 parents 6d49856 + 4592f4f commit 79516d6

24 files changed

+127
-31
lines changed
File renamed without changes.

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@ deploy:
1616
provider: releases
1717
api_key: $GITHUB_TOKEN
1818
file_glob: true
19-
file: bundles/*
19+
file: $TRAVIS_BUILD_DIR/bundles/*
2020
skip_cleanup: true
2121
overwrite: true
2222
on:
2323
tags: true
2424

2525
install:
26-
- pip install pylint circuitpython-build-tools
26+
- pip install pylint circuitpython-build-tools Sphinx sphinx-rtd-theme
2727

2828
script:
2929
- pylint adafruit_featherwing/*.py
3030
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name examples/**/*.py)
3131
- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-featherwing --library_location .
32+
- cd docs && sphinx-build -E -W -b html . _build/html

README.rst

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ Introduction
1010
:target: https://discord.gg/nBQh6qu
1111
:alt: Discord
1212
13+
.. image:: https://travis-ci.org/adafruit/Adafruit_CircuitPython_FeatherWing.svg?branch=master
14+
:target: https://travis-ci.org/adafruit/Adafruit_CircuitPython_FeatherWing
15+
:alt: Build Status
16+
1317
This library provides FeatherWing specific classes for those that require a significant amount of
1418
initialization.
1519

@@ -26,14 +30,6 @@ This is easily achieved by downloading
2630
`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_ and highly recommended over
2731
installing each one.
2832

29-
API Reference
30-
=============
31-
32-
.. toctree::
33-
:maxdepth: 2
34-
35-
api
36-
3733
Contributing
3834
============
3935

@@ -64,3 +60,26 @@ Then run the build:
6460
.. code-block:: shell
6561
6662
circuitpython-build-bundles --filename_prefix adafruit-circuitpython-featherwing --library_location .
63+
64+
Sphinx documentation
65+
-----------------------
66+
67+
Sphinx is used to build the documentation based on rST files and comments in the code. First,
68+
install dependencies (feel free to reuse the virtual environment from above):
69+
70+
.. code-block:: shell
71+
72+
python3 -m venv .env
73+
source .env/bin/activate
74+
pip install Sphinx sphinx-rtd-theme
75+
76+
Now, once you have the virtual environment activated:
77+
78+
.. code-block:: shell
79+
80+
cd docs
81+
sphinx-build -E -W -b html . _build/html
82+
83+
This will output the documentation to ``docs/_build/html``. Open the index.html in your browser to
84+
view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to
85+
locally verify it will pass.

adafruit_featherwing/ina219_featherwing.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __init__(self):
4747
def bus_voltage(self):
4848
"""Bus voltage returns volts.
4949
50-
.. image :: /_static/ina219_featherwing/ina219_featherwing.jpg
50+
.. image :: ../docs/_static/ina219_featherwing/ina219_featherwing.jpg
5151
:alt: INA219 Featherwing
5252
5353
This example prints the bus voltage with the appropriate units.
@@ -70,7 +70,7 @@ def bus_voltage(self):
7070
def shunt_voltage(self):
7171
"""Shunt voltage returns volts.
7272
73-
.. image :: /_static/ina219_featherwing/ina219_featherwing.jpg
73+
.. image :: ../docs/_static/ina219_featherwing/ina219_featherwing.jpg
7474
:alt: INA219 Featherwing
7575
7676
This example prints the shunt voltage with the appropriate units.
@@ -93,7 +93,7 @@ def shunt_voltage(self):
9393
def voltage(self):
9494
"""Voltage, known as load voltage, is bus voltage plus shunt voltage. Returns volts.
9595
96-
.. image :: /_static/ina219_featherwing/ina219_featherwing.jpg
96+
.. image :: ../docs/_static/ina219_featherwing/ina219_featherwing.jpg
9797
:alt: INA219 Featherwing
9898
9999
This example prints the voltage with the appropriate units.
@@ -117,7 +117,7 @@ def voltage(self):
117117
def current(self):
118118
"""Current returns mA.
119119
120-
.. image :: /_static/ina219_featherwing/ina219_featherwing.jpg
120+
.. image :: ../docs/_static/ina219_featherwing/ina219_featherwing.jpg
121121
:alt: INA219 Featherwing
122122
123123
This example prints the current with the appropriate units.

adafruit_featherwing/joy_featherwing.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def __init__(self):
5858
def button_a(self):
5959
"""Joy featherwing button A.
6060
61-
.. image :: /_static/joy_featherwing/joy_featherwing_a.jpg
61+
.. image :: ../docs/_static/joy_featherwing/joy_featherwing_a.jpg
6262
:alt: Joy FeatherWing Button A
6363
6464
This example prints when button A is pressed.
@@ -81,7 +81,7 @@ def button_a(self):
8181
def button_b(self):
8282
"""Joy featherwing button B.
8383
84-
.. image :: /_static/joy_featherwing/joy_featherwing_b.jpg
84+
.. image :: ../docs/_static/joy_featherwing/joy_featherwing_b.jpg
8585
:alt: Joy FeatherWing Button B
8686
8787
This example prints when button B is pressed.
@@ -104,7 +104,7 @@ def button_b(self):
104104
def button_x(self):
105105
"""Joy featherwing button X.
106106
107-
.. image :: /_static/joy_featherwing/joy_featherwing_x.jpg
107+
.. image :: ../docs/_static/joy_featherwing/joy_featherwing_x.jpg
108108
:alt: Joy FeatherWing Button X
109109
110110
This example prints when button X is pressed.
@@ -127,7 +127,7 @@ def button_x(self):
127127
def button_y(self):
128128
"""Joy featherwing button Y.
129129
130-
.. image :: /_static/joy_featherwing/joy_featherwing_y.jpg
130+
.. image :: ../docs/_static/joy_featherwing/joy_featherwing_y.jpg
131131
:alt: Joy FeatherWing Button Y
132132
133133
This example prints when button Y is pressed.
@@ -150,7 +150,7 @@ def button_y(self):
150150
def button_select(self):
151151
"""Joy featherwing button SELECT.
152152
153-
.. image :: /_static/joy_featherwing/joy_featherwing_select.jpg
153+
.. image :: ../docs/_static/joy_featherwing/joy_featherwing_select.jpg
154154
:alt: Joy FeatherWing Button SELECT
155155
156156
This example prints when button SELECT is pressed.
@@ -178,7 +178,7 @@ def _check_button(self, button):
178178
def joystick_offset(self):
179179
"""Offset used to correctly report (0, 0) when the joystick is centered.
180180
181-
.. image :: /_static/joy_featherwing/joy_featherwing_joystick.jpg
181+
.. image :: ../docs/_static/joy_featherwing/joy_featherwing_joystick.jpg
182182
:alt: Joy FeatherWing Joystick
183183
184184
Provide a tuple of (x, y) to set your joystick center to (0, 0).
@@ -220,7 +220,7 @@ def zero_joystick(self):
220220
Note: You must not be touching the joystick at the time of zeroing
221221
for it to be accurate.
222222
223-
.. image :: /_static/joy_featherwing/joy_featherwing_joystick.jpg
223+
.. image :: ../docs/_static/joy_featherwing/joy_featherwing_joystick.jpg
224224
:alt: Joy FeatherWing Joystick
225225
226226
This example zeros the joystick, and prints the coordinates of
@@ -252,7 +252,7 @@ def zero_joystick(self):
252252
def joystick(self):
253253
"""Joy FeatherWing joystick.
254254
255-
.. image :: /_static/joy_featherwing/joy_featherwing_joystick.jpg
255+
.. image :: ../docs/_static/joy_featherwing/joy_featherwing_joystick.jpg
256256
:alt: Joy FeatherWing Joystick
257257
258258
This example zeros the joystick, and prints the coordinates of

adafruit_featherwing/motor_featherwing.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def _motor(self, motor_name, channels, stepper_name):
7070
def motor1(self):
7171
""":py:class:`~adafruit_motor.motor.DCMotor` controls for motor 1.
7272
73-
.. image :: /_static/motor_featherwing/m1.jpg
73+
.. image :: ../docs/_static/motor_featherwing/m1.jpg
7474
:alt: Motor 1 location
7575
7676
This example moves the motor forwards for one fifth of a second at full speed.
@@ -93,7 +93,7 @@ def motor1(self):
9393
def motor2(self):
9494
""":py:class:`~adafruit_motor.motor.DCMotor` controls for motor 2.
9595
96-
.. image :: /_static/motor_featherwing/m2.jpg
96+
.. image :: ../docs/_static/motor_featherwing/m2.jpg
9797
:alt: Motor 2 location
9898
9999
This example moves the motor forwards for one fifth of a second at full speed.
@@ -116,7 +116,7 @@ def motor2(self):
116116
def motor3(self):
117117
""":py:class:`~adafruit_motor.motor.DCMotor` controls for motor 3.
118118
119-
.. image :: /_static/motor_featherwing/m3.jpg
119+
.. image :: ../docs/_static/motor_featherwing/m3.jpg
120120
:alt: Motor 3 location
121121
122122
This example moves the motor forwards for one fifth of a second at full speed.
@@ -139,7 +139,7 @@ def motor3(self):
139139
def motor4(self):
140140
""":py:class:`~adafruit_motor.motor.DCMotor` controls for motor 4.
141141
142-
.. image :: /_static/motor_featherwing/m4.jpg
142+
.. image :: ../docs/_static/motor_featherwing/m4.jpg
143143
:alt: Motor 4 location
144144
145145
This example moves the motor forwards for one fifth of a second at full speed.
@@ -163,7 +163,7 @@ def stepper1(self):
163163
""":py:class:`~adafruit_motor.stepper.StepperMotor` controls for one connected to stepper 1
164164
(also labeled motor 1 and motor 2).
165165
166-
.. image :: /_static/motor_featherwing/stepper1.jpg
166+
.. image :: ../docs/_static/motor_featherwing/stepper1.jpg
167167
:alt: Stepper 1 location
168168
169169
This example moves the stepper motor 100 steps forwards.
@@ -191,7 +191,7 @@ def stepper2(self):
191191
""":py:class:`~adafruit_motor.stepper.StepperMotor` controls for one connected to stepper 2
192192
(also labeled motor 3 and motor 4).
193193
194-
.. image :: /_static/motor_featherwing/stepper2.jpg
194+
.. image :: ../docs/_static/motor_featherwing/stepper2.jpg
195195
:alt: Stepper 2 location
196196
197197
This example moves the stepper motor 100 steps forwards.

docs/_static/favicon.ico

4.31 KB
Binary file not shown.

0 commit comments

Comments
 (0)