summaryrefslogtreecommitdiffstatshomepage
path: root/docs/conf.py
diff options
context:
space:
mode:
authorDaniel Campora <daniel@wipy.io>2015-05-27 13:59:59 +0200
committerDamien George <damien.p.george@gmail.com>2015-06-04 23:44:35 +0100
commit7ca1bd314bd5e3146f8c868f91af54d17dd04d45 (patch)
treec30c7ccb9a8437a9e69f2716f196b87f27beca5d /docs/conf.py
parent031278f661e5d285c56359e355a96161bf6e1a9f (diff)
downloadmicropython-7ca1bd314bd5e3146f8c868f91af54d17dd04d45.tar.gz
micropython-7ca1bd314bd5e3146f8c868f91af54d17dd04d45.zip
docs: Generate a separate docs build for each port.
Using Damien's approach where conf.py and topindex.html are shared by all ports.
Diffstat (limited to 'docs/conf.py')
-rwxr-xr-xdocs/conf.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/docs/conf.py b/docs/conf.py
index 5261bc5a4c..a3de50d81a 100755
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -134,7 +134,7 @@ else:
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
-#html_logo = '../logo/trans-logo.png'
+#html_logo = '../../logo/trans-logo.png'
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
@@ -277,3 +277,23 @@ texinfo_documents = [
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'http://docs.python.org/': None}
+
+
+# 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", "esp8266"),
+))
+
+# The members of the html_context dict are available inside topindex.html
+url_prefix = os.getenv('MICROPY_URL_PREFIX') or '/'
+html_context = {
+ 'port':micropy_port,
+ 'port_name':ports[micropy_port],
+ 'all_ports':[(n, url_prefix + p) for p, n in ports.items()],
+}