From b3e013f60ec0feb5b64bcadb45b154d093731c97 Mon Sep 17 00:00:00 2001
From: Damien George
Date: Thu, 27 Sep 2018 17:27:57 +1000
Subject: docs: Unify all the ports into one set of documentation.
With this commit there is now only one entry point into the whole
documentation, which describes the general MicroPython language, and then
from there there are links to information about specific platforms/ports.
This commit doesn't change content (almost, it does fix a few internal
links), it just reorganises things.
---
docs/conf.py | 52 +++----------------------------
docs/esp8266/general.rst | 2 ++
docs/esp8266/quickref.rst | 11 ++++++-
docs/esp8266/tutorial/index.rst | 2 +-
docs/esp8266_index.rst | 12 --------
docs/index.rst | 12 ++++++++
docs/pyboard/general.rst | 4 +++
docs/pyboard/hardware/index.rst | 2 --
docs/pyboard/quickref.rst | 11 ++++++-
docs/pyboard/tutorial/fading_led.rst | 2 +-
docs/pyboard/tutorial/index.rst | 2 +-
docs/pyboard_index.rst | 12 --------
docs/templates/topindex.html | 59 +++++++++++++++++-------------------
docs/templates/versions.html | 12 ++------
docs/unix_index.rst | 9 ------
docs/wipy/general.rst | 2 ++
docs/wipy/quickref.rst | 11 ++++++-
docs/wipy/tutorial/index.rst | 2 +-
docs/wipy/tutorial/intro.rst | 6 ++--
docs/wipy_index.rst | 12 --------
20 files changed, 93 insertions(+), 144 deletions(-)
delete mode 100644 docs/esp8266_index.rst
create mode 100644 docs/index.rst
delete mode 100644 docs/pyboard_index.rst
delete mode 100644 docs/unix_index.rst
delete mode 100644 docs/wipy_index.rst
(limited to 'docs')
diff --git a/docs/conf.py b/docs/conf.py
index bb8faea88..e85a68903 100755
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -21,42 +21,21 @@ import os
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('.'))
-# Work out the port to generate the docs for
-from collections import OrderedDict
-micropy_port = os.getenv('MICROPY_PORT') or 'pyboard'
-tags.add('port_' + micropy_port)
-ports = OrderedDict((
- ('unix', 'unix'),
- ('pyboard', 'the pyboard'),
- ('wipy', 'the WiPy'),
- ('esp8266', 'the ESP8266'),
-))
-
# The members of the html_context dict are available inside topindex.html
micropy_version = os.getenv('MICROPY_VERSION') or 'latest'
micropy_all_versions = (os.getenv('MICROPY_ALL_VERSIONS') or 'latest').split(',')
-url_pattern = '%s/en/%%s/%%s' % (os.getenv('MICROPY_URL_PREFIX') or '/',)
+url_pattern = '%s/en/%%s' % (os.getenv('MICROPY_URL_PREFIX') or '/',)
html_context = {
- 'port':micropy_port,
- 'port_name':ports[micropy_port],
- 'port_version':micropy_version,
- 'all_ports':[
- (port_id, url_pattern % (micropy_version, port_id))
- for port_id, port_name in ports.items()
- ],
+ 'cur_version':micropy_version,
'all_versions':[
- (ver, url_pattern % (ver, micropy_port))
- for ver in micropy_all_versions
+ (ver, url_pattern % ver) for ver in micropy_all_versions
],
'downloads':[
- ('PDF', url_pattern % (micropy_version, 'micropython-%s.pdf' % micropy_port)),
+ ('PDF', url_pattern % micropy_version + '/micropython-docs.pdf'),
],
}
-# Specify a custom master document based on the port name
-master_doc = micropy_port + '_' + 'index'
-
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
@@ -86,7 +65,7 @@ source_suffix = '.rst'
#source_encoding = 'utf-8-sig'
# The master toctree document.
-#master_doc = 'index'
+master_doc = 'index'
# General information about the project.
project = 'MicroPython'
@@ -323,24 +302,3 @@ texinfo_documents = [
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'python': ('http://docs.python.org/3.5', None)}
-
-# Append the other ports' specific folders/files to the exclude pattern
-exclude_patterns.extend([port + '*' for port in ports if port != micropy_port])
-
-modules_port_specific = {
- 'pyboard': ['pyb'],
- 'wipy': ['wipy'],
- 'esp8266': ['esp'],
-}
-
-modindex_exclude = []
-
-for p, l in modules_port_specific.items():
- if p != micropy_port:
- modindex_exclude += l
-
-# Exclude extra modules per port
-modindex_exclude += {
- 'esp8266': ['cmath', 'select'],
- 'wipy': ['cmath'],
-}.get(micropy_port, [])
diff --git a/docs/esp8266/general.rst b/docs/esp8266/general.rst
index fe1cdc1c6..020e21df6 100644
--- a/docs/esp8266/general.rst
+++ b/docs/esp8266/general.rst
@@ -1,3 +1,5 @@
+.. _esp8266_general:
+
General information about the ESP8266 port
==========================================
diff --git a/docs/esp8266/quickref.rst b/docs/esp8266/quickref.rst
index c510e4064..95ae55b57 100644
--- a/docs/esp8266/quickref.rst
+++ b/docs/esp8266/quickref.rst
@@ -1,4 +1,4 @@
-.. _quickref:
+.. _esp8266_quickref:
Quick reference for the ESP8266
===============================
@@ -9,6 +9,15 @@ Quick reference for the ESP8266
The Adafruit Feather HUZZAH board (image attribution: Adafruit).
+Below is a quick reference for ESP8266-based boards. If it is your first time
+working with this board please consider reading the following sections first:
+
+.. toctree::
+ :maxdepth: 1
+
+ general.rst
+ tutorial/index.rst
+
Installing MicroPython
----------------------
diff --git a/docs/esp8266/tutorial/index.rst b/docs/esp8266/tutorial/index.rst
index 39b459260..0a4b5f2a6 100644
--- a/docs/esp8266/tutorial/index.rst
+++ b/docs/esp8266/tutorial/index.rst
@@ -1,4 +1,4 @@
-.. _tutorial-index:
+.. _esp8266_tutorial:
MicroPython tutorial for ESP8266
================================
diff --git a/docs/esp8266_index.rst b/docs/esp8266_index.rst
deleted file mode 100644
index 519acecda..000000000
--- a/docs/esp8266_index.rst
+++ /dev/null
@@ -1,12 +0,0 @@
-MicroPython documentation and references
-========================================
-
-.. toctree::
-
- esp8266/quickref.rst
- esp8266/general.rst
- esp8266/tutorial/index.rst
- library/index.rst
- reference/index.rst
- genrst/index.rst
- license.rst
diff --git a/docs/index.rst b/docs/index.rst
new file mode 100644
index 000000000..af5ffb885
--- /dev/null
+++ b/docs/index.rst
@@ -0,0 +1,12 @@
+MicroPython documentation and references
+========================================
+
+.. toctree::
+
+ library/index.rst
+ reference/index.rst
+ genrst/index.rst
+ license.rst
+ pyboard/quickref.rst
+ esp8266/quickref.rst
+ wipy/quickref.rst
diff --git a/docs/pyboard/general.rst b/docs/pyboard/general.rst
index 97e9aabc0..0fc7332de 100644
--- a/docs/pyboard/general.rst
+++ b/docs/pyboard/general.rst
@@ -1,3 +1,5 @@
+.. _pyboard_general:
+
General information about the pyboard
=====================================
@@ -77,4 +79,6 @@ including setting up the serial prompt and downloading new firmware using
DFU programming:
`PDF guide
- MicroPython runs on a variety of systems and each has their own specific - documentation. You are currently viewing the documentation for - {{ port_name }}. + MicroPython runs on a variety of systems and hardware platforms. Here you can read + the general documentation which applies to all systems, as well as specific information + about the various platforms - + also known as ports + - that MicroPython runs on.
- - -Documentation for MicroPython and {{ port_name }}:
+General documentation for MicroPython:
|
- {% if port in ("pyboard", "wipy", "esp8266") %}
-
- Quick reference for {{ port_name }}
- General information about {{ port_name }}
- Tutorials and code examples
Library Reference
MicroPython Differences |
References and tutorials for specific platforms:
+ +|
+
+ Quick reference for the pyboard
+ Quick reference for the ESP8266
+ Quick reference for the WiPy/CC3200 |
+
Indices and tables:
+|
@@ -82,7 +79,7 @@ MicroPython terms explained
- Table of contents |