From e151b9e4d463b327a4deb3afca0437dd44281002 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 23:59:20 -0600 Subject: [PATCH 1/5] renamed example --- examples/simpletest.py | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 examples/simpletest.py diff --git a/examples/simpletest.py b/examples/simpletest.py deleted file mode 100644 index 493aee3..0000000 --- a/examples/simpletest.py +++ /dev/null @@ -1,20 +0,0 @@ -# Simple demo of printing the temperature from the first found DS18x20 sensor every second. -# Author: Tony DiCola -import time - -import board - -from adafruit_onewire.bus import OneWireBus -from adafruit_ds18x20 import DS18X20 - - -# Initialize one-wire bus on board pin D5. -ow_bus = OneWireBus(board.D5) - -# Scan for sensors and grab the first one found. -ds18 = DS18X20(ow_bus, ow_bus.scan()[0]) - -# Main loop to print the temperature every second. -while True: - print('Temperature: {0:0.3f}C'.format(ds18.temperature)) - time.sleep(1.0) From 988b4252a26204f8bf4cd907649aa10e70b94043 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sun, 25 Feb 2018 00:00:14 -0600 Subject: [PATCH 2/5] renamed example; forgot git add... --- examples/ds18x20_simpletest.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 examples/ds18x20_simpletest.py diff --git a/examples/ds18x20_simpletest.py b/examples/ds18x20_simpletest.py new file mode 100644 index 0000000..493aee3 --- /dev/null +++ b/examples/ds18x20_simpletest.py @@ -0,0 +1,20 @@ +# Simple demo of printing the temperature from the first found DS18x20 sensor every second. +# Author: Tony DiCola +import time + +import board + +from adafruit_onewire.bus import OneWireBus +from adafruit_ds18x20 import DS18X20 + + +# Initialize one-wire bus on board pin D5. +ow_bus = OneWireBus(board.D5) + +# Scan for sensors and grab the first one found. +ds18 = DS18X20(ow_bus, ow_bus.scan()[0]) + +# Main loop to print the temperature every second. +while True: + print('Temperature: {0:0.3f}C'.format(ds18.temperature)) + time.sleep(1.0) From e94b244440b13d3009ca9fd1cf559003c048b765 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sun, 25 Feb 2018 00:42:40 -0600 Subject: [PATCH 3/5] setup docs folder --- docs/_static/favicon.ico | Bin 0 -> 4414 bytes api.rst => docs/api.rst | 0 conf.py => docs/conf.py | 15 +++++++++--- docs/examples.rst | 8 ++++++ docs/index.rst | 51 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 docs/_static/favicon.ico rename api.rst => docs/api.rst (100%) rename conf.py => docs/conf.py (90%) create mode 100644 docs/examples.rst create mode 100644 docs/index.rst diff --git a/docs/_static/favicon.ico b/docs/_static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..5aca98376a1f7e593ebd9cf41a808512c2135635 GIT binary patch literal 4414 zcmd^BX;4#F6n=SG-XmlONeGrD5E6J{RVh+e928U#MG!$jWvO+UsvWh`x&VqGNx*en zx=qox7Dqv{kPwo%fZC$dDwVpRtz{HzTkSs8QhG0)%Y=-3@Kt!4ag|JcIo?$-F|?bXVS9UDUyev>MVZQ(H8K4#;BQW-t2CPorj8^KJrMX}QK zp+e<;4ldpXz~=)2GxNy811&)gt-}Q*yVQpsxr@VMoA##{)$1~=bZ1MmjeFw?uT(`8 z^g=09<=zW%r%buwN%iHtuKSg|+r7HkT0PYN*_u9k1;^Ss-Z!RBfJ?Un4w(awqp2b3 z%+myoFis_lTlCrGx2z$0BQdh+7?!JK#9K9@Z!VrG zNj6gK5r(b4?YDOLw|DPRoN7bdP{(>GEG41YcN~4r_SUHU2hgVtUwZG@s%edC;k7Sn zC)RvEnlq~raE2mY2ko64^m1KQL}3riixh?#J{o)IT+K-RdHae2eRX91-+g!y`8^># z-zI0ir>P%Xon)!@xp-BK2bDYUB9k613NRrY6%lVjbFcQc*pRqiK~8xtkNPLxt}e?&QsTB}^!39t_%Qb)~Ukn0O%iC;zt z<&A-y;3h++)>c1br`5VFM~5(83!HKx$L+my8sW_c#@x*|*vB1yU)_dt3vH;2hqPWx zAl^6@?ipx&U7pf`a*>Yq6C85nb+B=Fnn+(id$W#WB^uHAcZVG`qg;rWB}ubvi(Y>D z$ei>REw$#xp0SHAd^|1hq&9HJ=jKK8^zTH~nk)G?yUcmTh9vUM6Y0LMw4(gYVY$D$ zGl&WY&H<)BbJ&3sYbKjx1j^=3-0Q#f^}(aP1?8^`&FUWMp|rmtpK)bLQ1Zo?^s4jqK=Lfg*9&geMGVQ z#^-*!V`fG@;H&{M9S8%+;|h&Qrxym0Ar>WT4BCVLR8cGXF=JmEYN(sNT(9vl+S|%g z8r7nXQ(95i^`=+XHo|){$vf2$?=`F$^&wFlYXyXg$B{a>$-Fp+V}+D;9k=~Xl~?C4 zAB-;RKXdUzBJE{V&d&%R>aEfFe;vxqI$0@hwVM}gFeQR@j}a>DDxR+n+-*6|_)k%% z*mSpDV|=5I9!&VC&9tD%fcVygWZV!iIo2qFtm#!*(s|@ZT33*Ad;+<|3^+yrp*;oH zBSYLV(H1zTU?2WjrCQoQW)Z>J2a=dTriuvezBmu16`tM2fm7Q@d4^iqII-xFpwHGI zn9CL}QE*1vdj2PX{PIuqOe5dracsciH6OlAZATvE8rj6ykqdIjal2 z0S0S~PwHb-5?OQ-tU-^KTG@XNrEVSvo|HIP?H;7ZhYeZkhSqh-{reE!5di;1zk$#Y zCe7rOnlzFYJ6Z#Hm$GoidKB=2HBCwm`BbZVeZY4ukmG%1uz7p2URs6c9j-Gjj^oQV zsdDb3@k2e`C$1I5ML5U0Qs0C1GAp^?!*`=|Nm(vWz3j*j*8ucum2;r0^-6Aca=Gv) zc%}&;!+_*S2tlnnJnz0EKeRmw-Y!@9ob!XQBwiv}^u9MkaXHvM=!<3YX;+2#5Cj5pp?FEK750S3BgeSDtaE^ zXUM@xoV6yBFKfzvY20V&Lr0yC + + Waterproof DS18B20 Digital temperature sensor + extras + + High Temp Waterproof DS18B20 Digital temperature sensor + extras + +.. toctree:: + :caption: Other Links + + Download + CircuitPython Reference Documentation + CircuitPython Support Forum + Discord Chat + Adafruit Learning System + Adafruit Blog + Adafruit Store + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` From f7a6772006f984d75a279eef4cd5a1d20c00afec Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sun, 25 Feb 2018 00:44:14 -0600 Subject: [PATCH 4/5] updated .travis & .readthedocs yml --- readthedocs.yml => .readthedocs.yml | 0 .travis.yml | 6 ++++-- 2 files changed, 4 insertions(+), 2 deletions(-) rename readthedocs.yml => .readthedocs.yml (100%) diff --git a/readthedocs.yml b/.readthedocs.yml similarity index 100% rename from readthedocs.yml rename to .readthedocs.yml diff --git a/.travis.yml b/.travis.yml index 61c686b..df4b18e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,15 +16,17 @@ deploy: provider: releases api_key: $GITHUB_TOKEN file_glob: true - file: bundles/* + file: $TRAVIS_BUILD_DIR/bundles/* skip_cleanup: true + overwrite: true on: tags: true install: - - pip install pylint circuitpython-build-tools + - pip install pylint circuitpython-build-tools Sphinx sphinx-rtd-theme script: - pylint adafruit_ds18x20.py - ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name examples/*.py) - circuitpython-build-bundles --filename_prefix adafruit-circuitpython-ds18x20 --library_location . + - cd docs && sphinx-build -E -W -b html . _build/html From 80b349f7a9dd3e6b7ddf651f62b9dbeb3aa60170 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sun, 25 Feb 2018 00:45:27 -0600 Subject: [PATCH 5/5] updated README --- README.rst | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index c684fdf..e67122b 100644 --- a/README.rst +++ b/README.rst @@ -36,14 +36,6 @@ Usage Example ds18.temperature -API Reference -============= - -.. toctree:: - :maxdepth: 2 - - api - Contributing ============ @@ -74,3 +66,26 @@ Then run the build: .. code-block:: shell circuitpython-build-bundles --filename_prefix adafruit-circuitpython-ds18x20 --library_location . + +Sphinx documentation +----------------------- + +Sphinx is used to build the documentation based on rST files and comments in the code. First, +install dependencies (feel free to reuse the virtual environment from above): + +.. code-block:: shell + + python3 -m venv .env + source .env/bin/activate + pip install Sphinx sphinx-rtd-theme + +Now, once you have the virtual environment activated: + +.. code-block:: shell + + cd docs + sphinx-build -E -W -b html . _build/html + +This will output the documentation to ``docs/_build/html``. Open the index.html in your browser to +view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to +locally verify it will pass.