Skip to content

Commit cf52ebe

Browse files
authored
Merge pull request #132 from sommersoft/doc_all_the_things
Step 1: Build The Docs
2 parents 4b8a066 + 0538a6b commit cf52ebe

File tree

9 files changed

+531
-65
lines changed

9 files changed

+531
-65
lines changed

.readthedocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
python:
2+
version: 3

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,6 @@ deploy:
1919
on:
2020
tags: true
2121

22-
script: circuitpython-build-bundles --filename_prefix adafruit-circuitpython-bundle --library_location libraries --library_depth 2
22+
script:
23+
- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-bundle --library_location libraries --library_depth 2
24+
- cd docs && sphinx-build -E -W -b html . _build/html && cd ..

README.md

Lines changed: 0 additions & 64 deletions
This file was deleted.

README.rst

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
Adafruit CircuitPython Library Bundle
2+
=======================================
3+
4+
.. image:: https://readthedocs.org/projects/adafruit-circuitpython-bundle/badge/?version=latest
5+
:target: https://circuitpython.readthedocs.io/projects/bundle/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_Bundle.svg?branch=master
13+
:target: https://travis-ci.com/adafruit/Adafruit_CircuitPython_Bundle
14+
:alt: Build Status
15+
16+
This repo bundles a bunch of useful CircuitPython libraries into an easy to
17+
download zip file. CircuitPython boards can ship with the contents of the zip to
18+
make it easy to provide a lot of libraries by default.
19+
20+
Use
21+
=====
22+
To use the bundle download the zip (not source zip) from the
23+
`latest release <https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/latest>`_,
24+
unzip it and copy over the subfolders, such as ``lib``, into the root of your
25+
CircuitPython device. Make sure to indicate that it should be merged with the
26+
existing folder when it exists.
27+
28+
CPython
29+
--------
30+
**DO NOT** use this to install libraries on a Linux computer, such as the Raspberry Pi,
31+
with regular Python (aka CPython). Instead, use the python3 version of ``pip`` to install
32+
the libraries you want to use. It will automatically install dependencies for you. For example:
33+
34+
.. code::
35+
36+
pip3 install adafruit-circuitpython-lis3dh
37+
38+
Development
39+
============
40+
41+
After you clone this repository you must run ``git submodule init``
42+
and then ``git submodule update``.
43+
44+
Updating libraries
45+
-------------------
46+
To update the libraries run ``update-submodules.sh``. The script will fetch the
47+
latest code and update to the newest tag (not master).
48+
49+
To find libraries with commits that haven't been included in a release do:
50+
51+
.. code::
52+
53+
git submodule foreach "git log --oneline HEAD...origin/master"
54+
55+
Adding a library
56+
-----------------
57+
Determine the best location within ``libraries`` (``libraries/drivers/`` or
58+
``libraries/helpers/``)for the new library and then run:
59+
60+
.. code::
61+
62+
git submodule add <git url> libraries/<target directory>
63+
64+
The target directory should omit any CircuitPython specific prefixes such as
65+
``adafruit-circuitpython`` to simplify the listing.
66+
67+
Removing a library
68+
-------------------
69+
Only do this if you are replacing the module with an equivalent:
70+
71+
.. code::
72+
73+
git submodule deinit libraries/<target directory>
74+
git rm libraries/<target directory>
75+
76+
Building the bundle
77+
--------------------
78+
To build this bundle locally you'll need to install the
79+
`circuitpython-build-tools <https://github.com/adafruit/circuitpython-build-tools>`_ package.
80+
81+
.. code::
82+
83+
python3 -m venv .env
84+
source .env/bin/activate
85+
pip install circuitpython-build-tools
86+
87+
Once installed, make sure you are in the virtual environment:
88+
89+
.. code::
90+
91+
source .env/bin/activate
92+
93+
Then run the build:
94+
95+
.. code::
96+
97+
circuitpython-build-bundles --filename_prefix adafruit-circuitpython-bundle --library_location libraries --library_depth 2

docs/_static/favicon.ico

4.31 KB
Binary file not shown.

docs/conf.py

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
# -*- coding: utf-8 -*-
2+
3+
import os
4+
import sys
5+
sys.path.insert(0, os.path.abspath('..'))
6+
7+
# -- General configuration ------------------------------------------------
8+
9+
# Add any Sphinx extension module names here, as strings. They can be
10+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
11+
# ones.
12+
extensions = [
13+
'sphinx.ext.autodoc',
14+
'sphinx.ext.intersphinx',
15+
'sphinx.ext.napoleon',
16+
'sphinx.ext.todo',
17+
]
18+
19+
# TODO: Please Read!
20+
# Uncomment the below if you use native CircuitPython modules such as
21+
# digitalio, micropython and busio. List the modules you use. Without it, the
22+
# autodoc module docs will fail to generate with a warning.
23+
# autodoc_mock_imports = ["digitalio", "busio"]
24+
25+
26+
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None)}
27+
28+
# Add any paths that contain templates here, relative to this directory.
29+
templates_path = ['_templates']
30+
31+
source_suffix = '.rst'
32+
33+
# The master toctree document.
34+
master_doc = 'index'
35+
36+
# General information about the project.
37+
project = u'Adafruit CircuitPython Bundle'
38+
copyright = u'2019 Adafruit'
39+
author = u'Adabot'
40+
41+
# The version info for the project you're documenting, acts as replacement for
42+
# |version| and |release|, also used in various other places throughout the
43+
# built documents.
44+
#
45+
# The short X.Y version.
46+
version = u'1.0'
47+
# The full version, including alpha/beta/rc tags.
48+
release = u'1.0'
49+
50+
# The language for content autogenerated by Sphinx. Refer to documentation
51+
# for a list of supported languages.
52+
#
53+
# This is also used if you do content translation via gettext catalogs.
54+
# Usually you set "language" from the command line for these cases.
55+
language = None
56+
57+
# List of patterns, relative to source directory, that match files and
58+
# directories to ignore when looking for source files.
59+
# This patterns also effect to html_static_path and html_extra_path
60+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.env', 'CODE_OF_CONDUCT.md']
61+
62+
# The reST default role (used for this markup: `text`) to use for all
63+
# documents.
64+
#
65+
default_role = "any"
66+
67+
# If true, '()' will be appended to :func: etc. cross-reference text.
68+
#
69+
add_function_parentheses = True
70+
71+
# The name of the Pygments (syntax highlighting) style to use.
72+
pygments_style = 'sphinx'
73+
74+
# If true, `todo` and `todoList` produce output, else they produce nothing.
75+
todo_include_todos = False
76+
77+
# If this is True, todo emits a warning for each TODO entries. The default is False.
78+
todo_emit_warnings = True
79+
80+
napoleon_numpy_docstring = False
81+
82+
# -- Options for HTML output ----------------------------------------------
83+
84+
# The theme to use for HTML and HTML Help pages. See the documentation for
85+
# a list of builtin themes.
86+
#
87+
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
88+
89+
if not on_rtd: # only import and set the theme if we're building docs locally
90+
try:
91+
import sphinx_rtd_theme
92+
html_theme = 'sphinx_rtd_theme'
93+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), '.']
94+
except:
95+
html_theme = 'default'
96+
html_theme_path = ['.']
97+
else:
98+
html_theme_path = ['.']
99+
100+
# Add any paths that contain custom static files (such as style sheets) here,
101+
# relative to this directory. They are copied after the builtin static files,
102+
# so a file named "default.css" will overwrite the builtin "default.css".
103+
html_static_path = ['_static']
104+
105+
# The name of an image file (relative to this directory) to use as a favicon of
106+
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
107+
# pixels large.
108+
#
109+
html_favicon = '_static/favicon.ico'
110+
111+
# Output file base name for HTML help builder.
112+
htmlhelp_basename = 'AdafruitBundleLibrarydoc'
113+
114+
# -- Options for LaTeX output ---------------------------------------------
115+
116+
latex_elements = {
117+
# The paper size ('letterpaper' or 'a4paper').
118+
#
119+
# 'papersize': 'letterpaper',
120+
121+
# The font size ('10pt', '11pt' or '12pt').
122+
#
123+
# 'pointsize': '10pt',
124+
125+
# Additional stuff for the LaTeX preamble.
126+
#
127+
# 'preamble': '',
128+
129+
# Latex figure (float) alignment
130+
#
131+
# 'figure_align': 'htbp',
132+
}
133+
134+
# Grouping the document tree into LaTeX files. List of tuples
135+
# (source start file, target name, title,
136+
# author, documentclass [howto, manual, or own class]).
137+
latex_documents = [
138+
(master_doc, 'AdafruitBundleLibrary.tex', u'AdafruitBundle Documentation',
139+
author, 'manual'),
140+
]
141+
142+
# -- Options for manual page output ---------------------------------------
143+
144+
# One entry per manual page. List of tuples
145+
# (source start file, name, description, authors, manual section).
146+
man_pages = [
147+
(master_doc, 'AdafruitBundlelibrary', u'Adafruit Bundle Documentation',
148+
[author], 1)
149+
]
150+
151+
# -- Options for Texinfo output -------------------------------------------
152+
153+
# Grouping the document tree into Texinfo files. List of tuples
154+
# (source start file, target name, title, author,
155+
# dir menu entry, description, category)
156+
texinfo_documents = [
157+
(master_doc, 'AdafruitBundleLibrary', u'Adafruit Bundle Documentation',
158+
author, 'AdafruitBundleLibrary', 'One line description of project.',
159+
'Miscellaneous'),
160+
]

0 commit comments

Comments
 (0)