/ README.rst
README.rst
1 Introduction 2 ============ 3 4 .. image:: https://readthedocs.org/projects/adafruit-circuitpython-display_button/badge/?version=latest 5 :target: https://circuitpython.readthedocs.io/projects/display_button/en/latest/ 6 :alt: Documentation Status 7 8 .. image:: https://img.shields.io/discord/327254708534116352.svg 9 :target: https://discord.gg/nBQh6qu 10 :alt: Discord 11 12 .. image:: https://travis-ci.com/adafruit/Adafruit_CircuitPython_Display_Button.svg?branch=master 13 :target: https://travis-ci.com/adafruit/Adafruit_CircuitPython_Display_Button 14 :alt: Build Status 15 16 UI Buttons for displayio 17 18 19 Dependencies 20 ============= 21 This driver depends on: 22 23 * `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_ 24 25 Please ensure all dependencies are available on the CircuitPython filesystem. 26 This is easily achieved by downloading 27 `the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_. 28 29 Installing from PyPI 30 -------------------- 31 On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from 32 PyPI <https://pypi.org/project/adafruit-circuitpython-display_button/>`_. To install for current user: 33 34 .. code-block:: shell 35 36 pip3 install adafruit-circuitpython-display_button 37 38 To install system-wide (this may be required in some cases): 39 40 .. code-block:: shell 41 42 sudo pip3 install adafruit-circuitpython-display_button 43 44 To install in a virtual environment in your current project: 45 46 .. code-block:: shell 47 48 mkdir project-name && cd project-name 49 python3 -m venv .env 50 source .env/bin/activate 51 pip3 install adafruit-circuitpython-display_button 52 53 Usage Example 54 ============= 55 56 See examples in examples/ folder. 57 58 Contributing 59 ============ 60 61 Contributions are welcome! Please read our `Code of Conduct 62 <https://github.com/adafruit/Adafruit_CircuitPython_Display_Button/blob/master/CODE_OF_CONDUCT.md>`_ 63 before contributing to help this project stay welcoming. 64 65 Building locally 66 ================ 67 68 Zip release files 69 ----------------- 70 71 To build this library locally you'll need to install the 72 `circuitpython-build-tools <https://github.com/adafruit/circuitpython-build-tools>`_ package. 73 74 .. code-block:: shell 75 76 python3 -m venv .env 77 source .env/bin/activate 78 pip install circuitpython-build-tools 79 80 Once installed, make sure you are in the virtual environment: 81 82 .. code-block:: shell 83 84 source .env/bin/activate 85 86 Then run the build: 87 88 .. code-block:: shell 89 90 circuitpython-build-bundles --filename_prefix adafruit-circuitpython-display_button --library_location . 91 92 Sphinx documentation 93 ----------------------- 94 95 Sphinx is used to build the documentation based on rST files and comments in the code. First, 96 install dependencies (feel free to reuse the virtual environment from above): 97 98 .. code-block:: shell 99 100 python3 -m venv .env 101 source .env/bin/activate 102 pip install Sphinx sphinx-rtd-theme 103 104 Now, once you have the virtual environment activated: 105 106 .. code-block:: shell 107 108 cd docs 109 sphinx-build -E -W -b html . _build/html 110 111 This will output the documentation to ``docs/_build/html``. Open the index.html in your browser to 112 view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to 113 locally verify it will pass.