From d5bc1202ff8eda2955b68fa8cac762000cbe36f6 Mon Sep 17 00:00:00 2001 From: jposada202020 Date: Sat, 1 May 2021 10:03:28 -0400 Subject: [PATCH] Exposing API components in Readthedocs, adding examples to the ReadtheDocs API --- adafruit_progressbar/__init__.py | 2 +- adafruit_progressbar/horizontalprogressbar.py | 2 +- docs/api.rst | 3 ++ docs/examples.rst | 50 +++++++++++++++++++ docs/index.rst | 4 ++ 5 files changed, 59 insertions(+), 2 deletions(-) diff --git a/adafruit_progressbar/__init__.py b/adafruit_progressbar/__init__.py index e833f27..fae1577 100755 --- a/adafruit_progressbar/__init__.py +++ b/adafruit_progressbar/__init__.py @@ -3,7 +3,7 @@ # SPDX-License-Identifier: MIT """ -`progressbar_base` +`adafruit_progressbar` ================================================================================ Dynamic progress bar widget for CircuitPython displays diff --git a/adafruit_progressbar/horizontalprogressbar.py b/adafruit_progressbar/horizontalprogressbar.py index a82abdb..ee665e9 100755 --- a/adafruit_progressbar/horizontalprogressbar.py +++ b/adafruit_progressbar/horizontalprogressbar.py @@ -57,7 +57,7 @@ class HorizontalProgressBar(ProgressBarBase): Using the diagrams below, the bar will fill in the following directions:: -------------------------------- - | Left-to-right | 1-3 to 2-4 | + | Left-to-right | 1-3 to 2-4 | -------------------------------- | Right-to-left | 2-4 to 1-3 | -------------------------------- diff --git a/docs/api.rst b/docs/api.rst index c25e47d..00fe24c 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -6,6 +6,9 @@ API Definition .. If your library file(s) are nested in a directory (e.g. /adafruit_foo/foo.py) .. use this format as the module name: "adafruit_foo.foo" +.. automodule:: adafruit_progressbar + :members: + .. automodule:: adafruit_progressbar.horizontalprogressbar :members: :show-inheritance: diff --git a/docs/examples.rst b/docs/examples.rst index 8358935..1ba14c9 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -6,3 +6,53 @@ Ensure your device works with this simple test. .. literalinclude:: ../examples/progressbar_simpletest.py :caption: examples/progressbar_simpletest.py :linenos: + + +Vertical Simple test +-------------------- + +Simple test to show a vertical Progress bar + +.. literalinclude:: ../examples/progressbar_vertical_simpletest.py + :caption: examples/progressbar_vertical_simpletest.py + :linenos: + + +MatrixPortal Example +-------------------- + +Progressbar using the MatrixPortal + +.. literalinclude:: ../examples/progressbar_matrixportal.py + :caption: examples/examples/progressbar_matrixportal.py + :linenos: + + + +MagTag Example +--------------- + +Progressbar using the MagTag + +.. literalinclude:: ../examples/progressbar_magtag_simpletest.py + :caption: examples/progressbar_magtag_simpletest.py + :linenos: + + +DisplayIO Blinka +---------------- + +Progressbar using DisplayIO in Blinka + +.. literalinclude:: ../examples/progressbar_displayio_blinka.py + :caption: examples/progressbar_displayio_blinka.py + :linenos: + +Combined ProgressBar +-------------------- + +Example showing both a Vertical and an Horizontal ProgressBar + +.. literalinclude:: ../examples/progressbar_combined.py + :caption: examples/progressbar_combined.py + :linenos: diff --git a/docs/index.rst b/docs/index.rst index ed6f30e..b38d008 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -23,6 +23,10 @@ Table of Contents .. toctree:: :caption: Tutorials + ProgressBar Basics + + Adafruit MagTag COVID Vaccination Percent Tracker + .. toctree:: :caption: Related Products