Skip to content

Commit e1c9c35

Browse files
committed
Rework docs to include more things.
1 parent 0135995 commit e1c9c35

File tree

7 files changed

+77
-20
lines changed

7 files changed

+77
-20
lines changed
File renamed without changes.

README.rst

Lines changed: 58 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ Introduction to Adafruit's PCF8523 Real Time Clock (RTC) Library
66
:target: https://circuitpython.readthedocs.io/projects/pcf8523/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
12+
13+
.. image:: https://travis-ci.org/adafruit/Adafruit_CircuitPython_PCF8523.svg?branch=master
14+
:target: https://travis-ci.org/adafruit/Adafruit_CircuitPython_PCF8523
15+
:alt: Build Status
1216

1317
This is a great battery-backed real time clock (RTC) that allows your
1418
microcontroller project to keep track of time even if it is reprogrammed,
@@ -23,7 +27,7 @@ temperature compensated alternative, please check out the
2327
If you need a DS1307 for compatibility reasons, check out our
2428
`DS1307 RTC breakout <https://www.adafruit.com/products/3296>`_.
2529

26-
.. image:: 3295-00.jpg
30+
.. image:: docs/_static/3295-00.jpg
2731

2832
Dependencies
2933
=============
@@ -76,15 +80,15 @@ the RTC object:
7680
Date and time
7781
-------------
7882

79-
To set the time, you need to set ``datetime`` to a `time.struct_time` object:
83+
To set the time, you need to set datetime` to a `time.struct_time` object:
8084

8185
.. code:: python
8286
8387
rtc.datetime = time.struct_time((2017,1,9,15,6,0,0,9,-1))
8488
85-
After the RTC is set, you retrieve the time by reading the ``datetime``
86-
attribute and access the standard attributes of a struct_time such as `tm_year`,
87-
`tm_hour` and `tm_min`.
89+
After the RTC is set, you retrieve the time by reading the `datetime`
90+
attribute and access the standard attributes of a struct_time such as ``tm_year``,
91+
``tm_hour`` and ``tm_min``.
8892

8993
.. code:: python
9094
@@ -95,7 +99,7 @@ attribute and access the standard attributes of a struct_time such as `tm_year`,
9599
Alarm
96100
-----
97101

98-
To set the time, you need to set ``alarm`` to a tuple with a `time.struct_time`
102+
To set the time, you need to set `alarm` to a tuple with a `time.struct_time`
99103
object and string representing the frequency such as "hourly":
100104

101105
.. code:: python
@@ -111,10 +115,51 @@ After the RTC is set, you retrieve the alarm status by reading the
111115
print("wake up!")
112116
rtc.alarm_status = False
113117
114-
API Reference
115-
=============
118+
Table of Contents
119+
=================
120+
121+
.. toctree::
122+
:maxdepth: 4
123+
124+
self
125+
126+
.. toctree::
127+
:caption: Examples
128+
129+
docs/examples
130+
131+
.. toctree::
132+
:caption: API Reference
133+
:maxdepth: 3
134+
135+
docs/api
136+
137+
138+
.. toctree::
139+
:caption: Tutorials
140+
141+
Adafruit PCF8523 Real Time Clock <https://learn.adafruit.com/adafruit-pcf8523-real-time-clock?view=all>
142+
Adafruit Adalogger FeatherWing <https://learn.adafruit.com/adafruit-adalogger-featherwing?view=all>
116143

117144
.. toctree::
118-
:maxdepth: 2
145+
:caption: Related Products
146+
147+
Adafruit PCF8523 Real Time Clock Breakout <https://www.adafruit.com/product/3295>
148+
Adafruit Adalogger FeatherWing - RTC + SD <https://www.adafruit.com/product/2922>
149+
150+
.. toctree::
151+
:caption: Other Links
152+
153+
CircuitPython Reference Documentation <https://circuitpython.readthedocs.io>
154+
CircuitPython Support Forum <https://forums.adafruit.com/viewforum.php?f=60>
155+
Discord Chat <https://adafru.it/discord>
156+
Adafruit Learning System <https://learn.adafruit.com>
157+
Adafruit Blog <https://blog.adafruit.com>
158+
Adafruit Store <https://www.adafruit.com>
159+
160+
Indices and tables
161+
==================
119162

120-
api
163+
* :ref:`genindex`
164+
* :ref:`modindex`
165+
* :ref:`search`
File renamed without changes.

docs/_static/favicon.ico

4.31 KB
Binary file not shown.

api.rst renamed to docs/api.rst

File renamed without changes.

conf.py renamed to docs/conf.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#
1919
import os
2020
import sys
21-
sys.path.insert(0, os.path.abspath('.'))
21+
sys.path.insert(0, os.path.abspath('..'))
2222

2323
# -- General configuration ------------------------------------------------
2424

@@ -36,6 +36,11 @@
3636
'sphinx.ext.intersphinx'
3737
]
3838

39+
# Uncomment the below if you use native CircuitPython modules such as
40+
# digitalio, micropython and busio. List the modules you use. Without it, the
41+
# autodoc module docs will fail to generate with a warning.
42+
autodoc_mock_imports = ["adafruit_bus_device", "adafruit_register"]
43+
3944
# Add any paths that contain templates here, relative to this directory.
4045
templates_path = ['_templates']
4146

@@ -85,7 +90,7 @@
8590
# List of patterns, relative to source directory, that match files and
8691
# directories to ignore when looking for source files.
8792
# This patterns also effect to html_static_path and html_extra_path
88-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
93+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.env', 'CODE_OF_CONDUCT.md']
8994

9095
# The reST default role (used for this markup: `text`) to use for all
9196
# documents.
@@ -116,8 +121,10 @@
116121
# keep_warnings = False
117122

118123
# If true, `todo` and `todoList` produce output, else they produce nothing.
119-
todo_include_todos = True
124+
todo_include_todos = False
120125

126+
# If this is True, todo emits a warning for each TODO entries. The default is False.
127+
todo_emit_warnings = True
121128

122129
# -- Options for HTML output ----------------------------------------------
123130

@@ -160,11 +167,10 @@
160167
#
161168
# html_logo = None
162169

163-
# The name of an image file (relative to this directory) to use as a favicon of
164-
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
170+
# The name of an image file (within the static path) to use as favicon of the
171+
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
165172
# pixels large.
166-
#
167-
# html_favicon = None
173+
html_favicon = '_static/favicon.ico'
168174

169175
# Add any paths that contain custom static files (such as style sheets) here,
170176
# relative to this directory. They are copied after the builtin static files,

docs/examples.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Demo
2+
----
3+
4+
.. literalinclude:: ../examples/demo.py
5+
:caption: examples/demo.py
6+
:linenos:

0 commit comments

Comments
 (0)