@@ -6,9 +6,9 @@ Introduction
66 :target: https://circuitpython.readthedocs.io/projects/ds1307/en/latest/
77 :alt: Documentation Status
88
9- .. image :: https://badges.gitter.im/adafruit/circuitpython .svg
10- :target: https://gitter.im/adafruit/circuitpython?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge
11- :alt: Gitter
9+ .. image :: https://img.shields.io/discord/327254708534116352 .svg
10+ :target: https://discord.gg/nBQh6qu
11+ :alt: Discord
1212
1313 This is a great battery-backed real time clock (RTC) that allows your
1414microcontroller project to keep track of time even if it is reprogrammed,
@@ -24,16 +24,20 @@ If you do not need a DS1307, or you need a 3.3V-power/logic capable RTC
2424please check out our affordable
2525`PCF8523 RTC breakout <https://www.adafruit.com/products/3295 >`_.
2626
27- .. image :: 3296-00.jpg
27+ .. image :: ../docs/_static/3296-00.jpg
28+ :alt: DS1307
2829
2930Dependencies
3031=============
32+ This driver depends on:
3133
32- This driver depends on the `Register <https://github.com/adafruit/Adafruit_CircuitPython_Register >`_
33- and `Bus Device <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice >`_
34- libraries. Please ensure they are also available on the CircuitPython filesystem.
34+ * `Adafruit CircuitPython <https://github.com/adafruit/circuitpython >`_
35+ * `Bus Device <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice >`_
36+ * `Register <https://github.com/adafruit/Adafruit_CircuitPython_Register >`_
37+
38+ Please ensure all dependencies are available on the CircuitPython filesystem.
3539This is easily achieved by downloading
36- `a library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle >`_.
40+ `the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle >`_.
3741
3842Usage Notes
3943===========
@@ -47,16 +51,16 @@ Of course, you must import the library to use it:
4751 import time
4852
4953 All the Adafruit RTC libraries take an instantiated and active I2C object
50- (from the `busio ` library) as an argument to their constructor. The way to
54+ (from the `` busio ` ` library) as an argument to their constructor. The way to
5155create an I2C object depends on the board you are using. For boards with labeled
5256SCL and SDA pins, you can:
5357
5458.. code :: python
5559
5660 from board import *
5761
58- You can also use pins defined by the onboard `microcontroller ` through the
59- `microcontroller.pin ` module.
62+ You can also use pins defined by the onboard `` microcontroller ` ` through the
63+ `` microcontroller.pin ` ` module.
6064
6165Now, to initialize the I2C bus:
6266
@@ -78,19 +82,65 @@ To set the time, you need to set ``datetime`` to a `time.struct_time` object:
7882 rtc.datetime = time.struct_time((2017 ,1 ,9 ,15 ,6 ,0 ,0 ,9 ,- 1 ))
7983
8084 After the RTC is set, you retrieve the time by reading the ``datetime ``
81- attribute and access the standard attributes of a struct_time such as `tm_year `,
82- `tm_hour ` and `tm_min `.
85+ attribute and access the standard attributes of a struct_time such as `` tm_year ` `,
86+ `` tm_hour `` and `` tm_min ` `.
8387
8488.. code :: python
8589
8690 t = rtc.datetime
8791 print (t)
8892 print (t.tm_hour, t.tm_min)
8993
90- API Reference
91- =============
94+ Contributing
95+ ============
96+
97+ Contributions are welcome! Please read our `Code of Conduct
98+ <https://github.com/adafruit/Adafruit_CircuitPython_VEML6070/blob/master/CODE_OF_CONDUCT.md> `_
99+ before contributing to help this project stay welcoming.
100+
101+ Building locally
102+ ================
103+
104+ To build this library locally you'll need to install the
105+ `circuitpython-build-tools <https://github.com/adafruit/circuitpython-build-tools >`_ package.
106+
107+ .. code-block :: shell
108+
109+ python3 -m venv .env
110+ source .env/bin/activate
111+ pip install circuitpython-build-tools
112+
113+ Once installed, make sure you are in the virtual environment:
114+
115+ .. code-block :: shell
116+
117+ source .env/bin/activate
118+
119+ Then run the build:
120+
121+ .. code-block :: shell
122+
123+ circuitpython-build-bundles --filename_prefix adafruit-circuitpython-ds1307 --library_location .
124+
125+ Sphinx documentation
126+ -----------------------
127+
128+ Sphinx is used to build the documentation based on rST files and comments in the code. First,
129+ install dependencies (feel free to reuse the virtual environment from above):
130+
131+ .. code-block :: shell
132+
133+ python3 -m venv .env
134+ source .env/bin/activate
135+ pip install Sphinx sphinx-rtd-theme
136+
137+ Now, once you have the virtual environment activated:
138+
139+ .. code-block :: shell
92140
93- .. toctree ::
94- :maxdepth: 2
141+ cd docs
142+ sphinx-build -E -W -b html . _build/html
95143
96- api
144+ This will output the documentation to ``docs/_build/html ``. Open the index.html in your browser to
145+ view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to
146+ locally verify it will pass.
0 commit comments