Skip to content

Step 1: Build The Docs #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
python:
version: 3
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ deploy:
on:
tags: true

script: circuitpython-build-bundles --filename_prefix adafruit-circuitpython-bundle --library_location libraries --library_depth 2
script:
- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-bundle --library_location libraries --library_depth 2
- cd docs && sphinx-build -E -W -b html . _build/html && cd ..
64 changes: 0 additions & 64 deletions README.md

This file was deleted.

97 changes: 97 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
Adafruit CircuitPython Library Bundle
=======================================

.. image:: https://readthedocs.org/projects/adafruit-circuitpython-bundle/badge/?version=latest
:target: https://circuitpython.readthedocs.io/projects/bundle/en/latest/
:alt: Documentation Status

.. image:: https://img.shields.io/discord/327254708534116352.svg
:target: https://discord.gg/nBQh6qu
:alt: Discord

.. image:: https://travis-ci.com/adafruit/Adafruit_CircuitPython_Bundle.svg?branch=master
:target: https://travis-ci.com/adafruit/Adafruit_CircuitPython_Bundle
:alt: Build Status

This repo bundles a bunch of useful CircuitPython libraries into an easy to
download zip file. CircuitPython boards can ship with the contents of the zip to
make it easy to provide a lot of libraries by default.

Use
=====
To use the bundle download the zip (not source zip) from the
`latest release <https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/latest>`_,
unzip it and copy over the subfolders, such as ``lib``, into the root of your
CircuitPython device. Make sure to indicate that it should be merged with the
existing folder when it exists.

CPython
--------
**DO NOT** use this to install libraries on a Linux computer, such as the Raspberry Pi,
with regular Python (aka CPython). Instead, use the python3 version of ``pip`` to install
the libraries you want to use. It will automatically install dependencies for you. For example:

.. code::
pip3 install adafruit-circuitpython-lis3dh
Development
============

After you clone this repository you must run ``git submodule init``
and then ``git submodule update``.

Updating libraries
-------------------
To update the libraries run ``update-submodules.sh``. The script will fetch the
latest code and update to the newest tag (not master).

To find libraries with commits that haven't been included in a release do:

.. code::
git submodule foreach "git log --oneline HEAD...origin/master"
Adding a library
-----------------
Determine the best location within ``libraries`` (``libraries/drivers/`` or
``libraries/helpers/``)for the new library and then run:

.. code::
git submodule add <git url> libraries/<target directory>
The target directory should omit any CircuitPython specific prefixes such as
``adafruit-circuitpython`` to simplify the listing.

Removing a library
-------------------
Only do this if you are replacing the module with an equivalent:

.. code::
git submodule deinit libraries/<target directory>
git rm libraries/<target directory>
Building the bundle
--------------------
To build this bundle locally you'll need to install the
`circuitpython-build-tools <https://github.com/adafruit/circuitpython-build-tools>`_ package.

.. code::
python3 -m venv .env
source .env/bin/activate
pip install circuitpython-build-tools
Once installed, make sure you are in the virtual environment:

.. code::
source .env/bin/activate
Then run the build:

.. code::
circuitpython-build-bundles --filename_prefix adafruit-circuitpython-bundle --library_location libraries --library_depth 2
Binary file added docs/_static/favicon.ico
Binary file not shown.
160 changes: 160 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# -*- coding: utf-8 -*-

import os
import sys
sys.path.insert(0, os.path.abspath('..'))

# -- General configuration ------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.napoleon',
'sphinx.ext.todo',
]

# TODO: Please Read!
# Uncomment the below if you use native CircuitPython modules such as
# digitalio, micropython and busio. List the modules you use. Without it, the
# autodoc module docs will fail to generate with a warning.
# autodoc_mock_imports = ["digitalio", "busio"]


intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None)}

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'Adafruit CircuitPython Bundle'
copyright = u'2019 Adafruit'
author = u'Adabot'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = u'1.0'
# The full version, including alpha/beta/rc tags.
release = u'1.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.env', 'CODE_OF_CONDUCT.md']

# The reST default role (used for this markup: `text`) to use for all
# documents.
#
default_role = "any"

# If true, '()' will be appended to :func: etc. cross-reference text.
#
add_function_parentheses = True

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False

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

napoleon_numpy_docstring = False

# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

if not on_rtd: # only import and set the theme if we're building docs locally
try:
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), '.']
except:
html_theme = 'default'
html_theme_path = ['.']
else:
html_theme_path = ['.']

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# The name of an image file (relative to this directory) to use as a favicon of
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#
html_favicon = '_static/favicon.ico'

# Output file base name for HTML help builder.
htmlhelp_basename = 'AdafruitBundleLibrarydoc'

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'AdafruitBundleLibrary.tex', u'AdafruitBundle Documentation',
author, 'manual'),
]

# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'AdafruitBundlelibrary', u'Adafruit Bundle Documentation',
[author], 1)
]

# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'AdafruitBundleLibrary', u'Adafruit Bundle Documentation',
author, 'AdafruitBundleLibrary', 'One line description of project.',
'Miscellaneous'),
]
Loading