Skip to content

Commit 3d20d26

Browse files
authored
Merge pull request #9 from sommersoft/new_docs
Improve Ref Docs
2 parents 19446a1 + 4bac82a commit 3d20d26

File tree

10 files changed

+273
-366
lines changed

10 files changed

+273
-366
lines changed
File renamed without changes.

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +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
21+
overwrite: true
2122
on:
2223
tags: true
2324

2425
install:
25-
- pip install pylint circuitpython-build-tools
26+
- pip install pylint circuitpython-build-tools Sphinx sphinx-rtd-theme
2627

2728
script:
2829
- pylint adafruit_mcp9808.py
2930
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name examples/*.py)
3031
- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-mcp9808 --library_location .
32+
- cd docs && sphinx-build -E -W -b html . _build/html

README.rst

Lines changed: 58 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@ over I2C. Its available on `Adafruit as a breakout <https://www.adafruit.com/pro
1616

1717
Dependencies
1818
=============
19+
This driver depends on:
1920

20-
This driver depends on the `Bus Device <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice>`_
21-
library. Please ensure it is also available on the CircuitPython filesystem. This is easily achieved by downloading
22-
`a library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_.
21+
* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_
22+
* `Bus Device <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice>`_
23+
24+
Please ensure all dependencies are available on the CircuitPython filesystem.
25+
This is easily achieved by downloading
26+
`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_.
2327

2428
Usage Notes
2529
===========
@@ -46,10 +50,56 @@ Then, construct the thermometer class:
4650
# Finally, read the temperature property and print it out
4751
print(t.temperature)
4852
49-
API Reference
50-
=============
53+
Contributing
54+
============
55+
56+
Contributions are welcome! Please read our `Code of Conduct
57+
<https://github.com/adafruit/Adafruit_CircuitPython_mcp9808/blob/master/CODE_OF_CONDUCT.md>`_
58+
before contributing to help this project stay welcoming.
59+
60+
Building locally
61+
================
62+
63+
To build this library locally you'll need to install the
64+
`circuitpython-build-tools <https://github.com/adafruit/circuitpython-build-tools>`_ package.
65+
66+
.. code-block:: shell
67+
68+
python3 -m venv .env
69+
source .env/bin/activate
70+
pip install circuitpython-build-tools
71+
72+
Once installed, make sure you are in the virtual environment:
73+
74+
.. code-block:: shell
75+
76+
source .env/bin/activate
77+
78+
Then run the build:
79+
80+
.. code-block:: shell
81+
82+
circuitpython-build-bundles --filename_prefix adafruit-circuitpython-mcp9808 --library_location .
83+
84+
Sphinx documentation
85+
-----------------------
86+
87+
Sphinx is used to build the documentation based on rST files and comments in the code. First,
88+
install dependencies (feel free to reuse the virtual environment from above):
89+
90+
.. code-block:: shell
91+
92+
python3 -m venv .env
93+
source .env/bin/activate
94+
pip install Sphinx sphinx-rtd-theme
95+
96+
Now, once you have the virtual environment activated:
97+
98+
.. code-block:: shell
5199
52-
.. toctree::
53-
:maxdepth: 2
100+
cd docs
101+
sphinx-build -E -W -b html . _build/html
54102
55-
api
103+
This will output the documentation to ``docs/_build/html``. Open the index.html in your browser to
104+
view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to
105+
locally verify it will pass.

0 commit comments

Comments
 (0)