Skip to content
Snippets Groups Projects
Commit aec189a5 authored by evildmp's avatar evildmp Committed by Damien George
Browse files

docs: Add optional sphinx_rtd_theme; add docs build instructions.

The sphinx_rtd_theme is used by ReadTheDocs to render a pretty looking
documentation.  If you have this theme installed locally then your
locally-compiled docs will look exactly like the published
documentation.   Otherwise it falls back to the default theme.
parent ca0b0cb8
No related branches found
No related tags found
No related merge requests found
...@@ -98,3 +98,18 @@ AUR. If the above does not work it may be because you don't have the ...@@ -98,3 +98,18 @@ AUR. If the above does not work it may be because you don't have the
correct permissions. Try then: correct permissions. Try then:
$ sudo dfu-util -a 0 -d 0483:df11 -D build-PYBV10/firmware.dfu $ sudo dfu-util -a 0 -d 0483:df11 -D build-PYBV10/firmware.dfu
Building the documentation locally
----------------------------------
Install Sphinx, and optionally (for the RTD-styling), sphinx_rtd_theme,
preferably in a virtualenv:
pip install sphinx
pip install sphinx_rtd_theme
In `micropython/docs`, build the docs:
make html
You'll find the index page at `micropython/docs/build/html/index.html`.
docs/conf.py 100644 → 100755
...@@ -103,9 +103,17 @@ pygments_style = 'sphinx' ...@@ -103,9 +103,17 @@ pygments_style = 'sphinx'
# -- Options for HTML output ---------------------------------------------- # -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for # on_rtd is whether we are on readthedocs.org
# 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 = 'default'
html_theme_path = ['.']
# Theme options are theme-specific and customize the look and feel of a theme # Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the # further. For a list of options available for each theme, see the
...@@ -113,7 +121,7 @@ html_theme = 'default' ...@@ -113,7 +121,7 @@ html_theme = 'default'
#html_theme_options = {} #html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory. # Add any paths that contain custom themes here, relative to this directory.
html_theme_path = ['.'] # html_theme_path = ['.']
# The name for this set of Sphinx documents. If None, it defaults to # The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation". # "<project> v<release> documentation".
...@@ -234,7 +242,7 @@ latex_documents = [ ...@@ -234,7 +242,7 @@ latex_documents = [
# (source start file, name, description, authors, manual section). # (source start file, name, description, authors, manual section).
man_pages = [ man_pages = [
('index', 'micropython', 'Micro Python Documentation', ('index', 'micropython', 'Micro Python Documentation',
['Damien P. George'], 1) ['Damien P. George'], 1),
] ]
# If true, show URL addresses after external links. # If true, show URL addresses after external links.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment