Skip to content

Commit 2234b59

Browse files
authored
Merge pull request #4 from sommersoft/new_docs
Improve Ref Docs
2 parents 378de5e + 1e042ec commit 2234b59

File tree

10 files changed

+133
-18
lines changed

10 files changed

+133
-18
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_rfm69.py
3030
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace,line-too-long examples/*.py)
3131
- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-rfm69 --library_location .
32+
- cd docs && sphinx-build -E -W -b html . _build/html

README.rst

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ Introduction
1010
:target: https://discord.gg/nBQh6qu
1111
:alt: Discord
1212
13-
.. image:: https://travis-ci.org/adafruit/Adafruit_CircuitPython_RFM69.svg?branch=master
14-
:target: https://travis-ci.org/adafruit/Adafruit_CircuitPython_RFM69
15-
:alt: Build Status
16-
1713
CircuitPython RFM69 packet radio module. This supports basic RadioHead-compatible sending and
1814
receiving of packets with RFM69 series radios (433/915Mhz).
1915

@@ -40,15 +36,7 @@ This is easily achieved by downloading
4036
Usage Example
4137
=============
4238

43-
See examples/simpletest.py for a simple demo of the usage.
44-
45-
API Reference
46-
=============
47-
48-
.. toctree::
49-
:maxdepth: 2
50-
51-
api
39+
See examples/rfm69_simpletest.py for a simple demo of the usage.
5240

5341
Contributing
5442
============
@@ -80,3 +68,26 @@ Then run the build:
8068
.. code-block:: shell
8169
8270
circuitpython-build-bundles --filename_prefix adafruit-circuitpython-rfm69 --library_location .
71+
72+
Sphinx documentation
73+
-----------------------
74+
75+
Sphinx is used to build the documentation based on rST files and comments in the code. First,
76+
install dependencies (feel free to reuse the virtual environment from above):
77+
78+
.. code-block:: shell
79+
80+
python3 -m venv .env
81+
source .env/bin/activate
82+
pip install Sphinx sphinx-rtd-theme
83+
84+
Now, once you have the virtual environment activated:
85+
86+
.. code-block:: shell
87+
88+
cd docs
89+
sphinx-build -E -W -b html . _build/html
90+
91+
This will output the documentation to ``docs/_build/html``. Open the index.html in your browser to
92+
view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to
93+
locally verify it will pass.

adafruit_rfm69.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,35 @@
3737
receiving a 60 byte packet at a time--don't try to receive many kilobytes of data at a time!
3838
3939
* Author(s): Tony DiCola
40+
41+
Implementation Notes
42+
--------------------
43+
44+
**Hardware:**
45+
46+
* Adafruit `RFM69HCW Transceiver Radio Breakout - 868 or 915 MHz - RadioFruit
47+
<https://www.adafruit.com/product/3070>`_ (Product ID: 3070)
48+
49+
* Adafruit `RFM69HCW Transceiver Radio Breakout - 433 MHz - RadioFruit
50+
<https://www.adafruit.com/product/3071>`_ (Product ID: 3071)
51+
52+
* Adafruit `Feather M0 RFM69HCW Packet Radio - 868 or 915 MHz - RadioFruit
53+
<https://www.adafruit.com/product/3176>`_ (Product ID: 3176)
54+
55+
* Adafruit `Feather M0 RFM69HCW Packet Radio - 433 MHz - RadioFruit
56+
<https://www.adafruit.com/product/3177>`_ (Product ID: 3177)
57+
58+
* Adafruit `Radio FeatherWing - RFM69HCW 900MHz - RadioFruit
59+
<https://www.adafruit.com/product/3229>`_ (Product ID: 3229)
60+
61+
* Adafruit `Radio FeatherWing - RFM69HCW 433MHz - RadioFruit
62+
<https://www.adafruit.com/product/3230>`_ (Product ID: 3230)
63+
64+
**Software and Dependencies:**
65+
66+
* Adafruit CircuitPython firmware for the ESP8622 and M0-based boards:
67+
https://github.com/adafruit/circuitpython/releases
68+
* Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
4069
"""
4170
import time
4271

docs/_static/favicon.ico

4.31 KB
Binary file not shown.

api.rst renamed to docs/api.rst

File renamed without changes.

conf.py renamed to docs/conf.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import os
44
import sys
5-
sys.path.insert(0, os.path.abspath('.'))
5+
sys.path.insert(0, os.path.abspath('..'))
66

77
# -- General configuration ------------------------------------------------
88

@@ -28,7 +28,7 @@
2828
source_suffix = '.rst'
2929

3030
# The master toctree document.
31-
master_doc = 'README'
31+
master_doc = 'index'
3232

3333
# General information about the project.
3434
project = u'Adafruit RFM69 Library'
@@ -54,7 +54,7 @@
5454
# List of patterns, relative to source directory, that match files and
5555
# directories to ignore when looking for source files.
5656
# This patterns also effect to html_static_path and html_extra_path
57-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
57+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.env', 'CODE_OF_CONDUCT.md']
5858

5959
# The reST default role (used for this markup: `text`) to use for all
6060
# documents.
@@ -71,6 +71,9 @@
7171
# If true, `todo` and `todoList` produce output, else they produce nothing.
7272
todo_include_todos = False
7373

74+
# If this is True, todo emits a warning for each TODO entries. The default is False.
75+
todo_emit_warnings = True
76+
7477

7578
# -- Options for HTML output ----------------------------------------------
7679

@@ -95,6 +98,12 @@
9598
# so a file named "default.css" will overwrite the builtin "default.css".
9699
html_static_path = ['_static']
97100

101+
# The name of an image file (relative to this directory) to use as a favicon of
102+
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
103+
# pixels large.
104+
#
105+
html_favicon = '_static/favicon.ico'
106+
98107
# Output file base name for HTML help builder.
99108
htmlhelp_basename = 'AdafruitRfm69Librarydoc'
100109

docs/examples.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Simple test
2+
------------
3+
4+
Ensure your device works with this simple test.
5+
6+
.. literalinclude:: ../examples/rfm69_simpletest.py
7+
:caption: examples/rfm69_simpletest.py
8+
:linenos:

docs/index.rst

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
.. include:: ../README.rst
2+
3+
Table of Contents
4+
=================
5+
6+
.. toctree::
7+
:maxdepth: 4
8+
:hidden:
9+
10+
self
11+
12+
.. toctree::
13+
:caption: Examples
14+
15+
examples
16+
17+
.. toctree::
18+
:caption: API Reference
19+
:maxdepth: 3
20+
21+
api
22+
23+
.. toctree::
24+
:caption: Tutorials
25+
26+
.. toctree::
27+
:caption: Related Products
28+
29+
Adafruit RFM69HCW Transceiver Radio Breakout - 868 or 915 MHz - RadioFruit <https://www.adafruit.com/product/3070>
30+
31+
Adafruit RFM69HCW Transceiver Radio Breakout - 433 MHz - RadioFruit <https://www.adafruit.com/product/3071>
32+
33+
Adafruit Feather M0 RFM69HCW Packet Radio - 868 or 915 MHz - RadioFruit <https://www.adafruit.com/product/3176>
34+
35+
Adafruit Feather M0 RFM69HCW Packet Radio - 433 MHz - RadioFruit <https://www.adafruit.com/product/3177>
36+
37+
Adafruit Radio FeatherWing - RFM69HCW 900MHz - RadioFruit <https://www.adafruit.com/product/3229>
38+
39+
Adafruit Radio FeatherWing - RFM69HCW 433MHz - RadioFruit <https://www.adafruit.com/product/3230>
40+
41+
.. toctree::
42+
:caption: Other Links
43+
44+
Download <https://github.com/adafruit/Adafruit_CircuitPython_RFM69/releases/latest>
45+
CircuitPython Reference Documentation <https://circuitpython.readthedocs.io>
46+
CircuitPython Support Forum <https://forums.adafruit.com/viewforum.php?f=60>
47+
Discord Chat <https://adafru.it/discord>
48+
Adafruit Learning System <https://learn.adafruit.com>
49+
Adafruit Blog <https://blog.adafruit.com>
50+
Adafruit Store <https://www.adafruit.com>
51+
52+
Indices and tables
53+
==================
54+
55+
* :ref:`genindex`
56+
* :ref:`modindex`
57+
* :ref:`search`
File renamed without changes.

0 commit comments

Comments
 (0)