summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rwxr-xr-xdocs/conf.py22
-rw-r--r--docs/contents.rst25
-rw-r--r--docs/index.rst28
-rw-r--r--docs/pyboard/general.rst (renamed from docs/general.rst)0
-rw-r--r--docs/pyboard/hardware/index.rst (renamed from docs/hardware/index.rst)0
-rw-r--r--docs/pyboard/quickref.rst (renamed from docs/quickref.rst)0
-rw-r--r--docs/pyboard/tutorial/accel.rst (renamed from docs/tutorial/accel.rst)0
-rw-r--r--docs/pyboard/tutorial/amp_skin.rst (renamed from docs/tutorial/amp_skin.rst)0
-rw-r--r--docs/pyboard/tutorial/assembler.rst (renamed from docs/tutorial/assembler.rst)0
-rw-r--r--docs/pyboard/tutorial/debounce.rst (renamed from docs/tutorial/debounce.rst)0
-rw-r--r--docs/pyboard/tutorial/fading_led.rst (renamed from docs/tutorial/fading_led.rst)0
-rw-r--r--docs/pyboard/tutorial/img/fading_leds_breadboard_fritzing.png (renamed from docs/tutorial/img/fading_leds_breadboard_fritzing.png)bin61821 -> 61821 bytes
-rw-r--r--docs/pyboard/tutorial/img/pyboard_servo.jpg (renamed from docs/tutorial/img/pyboard_servo.jpg)bin70642 -> 70642 bytes
-rw-r--r--docs/pyboard/tutorial/img/pyboard_usb_micro.jpg (renamed from docs/tutorial/img/pyboard_usb_micro.jpg)bin86846 -> 86846 bytes
-rw-r--r--docs/pyboard/tutorial/img/skin_amp_1.jpg (renamed from docs/tutorial/img/skin_amp_1.jpg)bin83408 -> 83408 bytes
-rw-r--r--docs/pyboard/tutorial/img/skin_amp_2.jpg (renamed from docs/tutorial/img/skin_amp_2.jpg)bin75075 -> 75075 bytes
-rw-r--r--docs/pyboard/tutorial/img/skin_lcd_1.jpg (renamed from docs/tutorial/img/skin_lcd_1.jpg)bin99320 -> 99320 bytes
-rw-r--r--docs/pyboard/tutorial/img/skin_lcd_2.jpg (renamed from docs/tutorial/img/skin_lcd_2.jpg)bin69460 -> 69460 bytes
-rw-r--r--docs/pyboard/tutorial/index.rst (renamed from docs/tutorial/index.rst)0
-rw-r--r--docs/pyboard/tutorial/intro.rst (renamed from docs/tutorial/intro.rst)0
-rw-r--r--docs/pyboard/tutorial/lcd_skin.rst (renamed from docs/tutorial/lcd_skin.rst)0
-rw-r--r--docs/pyboard/tutorial/leds.rst (renamed from docs/tutorial/leds.rst)0
-rw-r--r--docs/pyboard/tutorial/pass_through.rst (renamed from docs/tutorial/pass_through.rst)0
-rw-r--r--docs/pyboard/tutorial/power_ctrl.rst (renamed from docs/tutorial/power_ctrl.rst)0
-rw-r--r--docs/pyboard/tutorial/repl.rst (renamed from docs/tutorial/repl.rst)0
-rw-r--r--docs/pyboard/tutorial/reset.rst (renamed from docs/tutorial/reset.rst)0
-rw-r--r--docs/pyboard/tutorial/script.rst (renamed from docs/tutorial/script.rst)0
-rw-r--r--docs/pyboard/tutorial/servo.rst (renamed from docs/tutorial/servo.rst)0
-rw-r--r--docs/pyboard/tutorial/switch.rst (renamed from docs/tutorial/switch.rst)0
-rw-r--r--docs/pyboard/tutorial/timer.rst (renamed from docs/tutorial/timer.rst)0
-rw-r--r--docs/pyboard/tutorial/usb_mouse.rst (renamed from docs/tutorial/usb_mouse.rst)0
-rw-r--r--docs/topindex.html61
32 files changed, 94 insertions, 42 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()],
+}
diff --git a/docs/contents.rst b/docs/contents.rst
index e5d3ad3297..b35e80d85f 100644
--- a/docs/contents.rst
+++ b/docs/contents.rst
@@ -1,11 +1,20 @@
Micro Python documentation contents
===================================
-.. toctree::
-
- quickref.rst
- general.rst
- tutorial/index.rst
- library/index.rst
- hardware/index.rst
- license.rst
+.. only:: port_pyboard
+
+ .. toctree::
+
+ pyboard/quickref.rst
+ pyboard/general.rst
+ pyboard/tutorial/index.rst
+ library/index.rst
+ pyboard/hardware/index.rst
+ license.rst
+
+.. only:: port_esp8266
+
+ .. toctree::
+
+ library/index.rst
+ license.rst
diff --git a/docs/index.rst b/docs/index.rst
index c11677efd5..e86ff857b7 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -1,15 +1,25 @@
Micro Python documentation and references
=========================================
-.. toctree::
-
- quickref.rst
- general.rst
- tutorial/index.rst
- library/index.rst
- hardware/index.rst
- license.rst
- contents.rst
+.. only:: port_pyboard
+
+ .. toctree::
+
+ pyboard/quickref.rst
+ pyboard/general.rst
+ pyboard/tutorial/index.rst
+ library/index.rst
+ pyboard/hardware/index.rst
+ license.rst
+ contents.rst
+
+.. only:: port_esp8266
+
+ .. toctree::
+
+ library/index.rst
+ license.rst
+ contents.rst
Indices and tables
==================
diff --git a/docs/general.rst b/docs/pyboard/general.rst
index 107bae69a7..107bae69a7 100644
--- a/docs/general.rst
+++ b/docs/pyboard/general.rst
diff --git a/docs/hardware/index.rst b/docs/pyboard/hardware/index.rst
index b64908c56d..b64908c56d 100644
--- a/docs/hardware/index.rst
+++ b/docs/pyboard/hardware/index.rst
diff --git a/docs/quickref.rst b/docs/pyboard/quickref.rst
index 2a1429cb05..2a1429cb05 100644
--- a/docs/quickref.rst
+++ b/docs/pyboard/quickref.rst
diff --git a/docs/tutorial/accel.rst b/docs/pyboard/tutorial/accel.rst
index 58170e74ff..58170e74ff 100644
--- a/docs/tutorial/accel.rst
+++ b/docs/pyboard/tutorial/accel.rst
diff --git a/docs/tutorial/amp_skin.rst b/docs/pyboard/tutorial/amp_skin.rst
index 9aaf84c753..9aaf84c753 100644
--- a/docs/tutorial/amp_skin.rst
+++ b/docs/pyboard/tutorial/amp_skin.rst
diff --git a/docs/tutorial/assembler.rst b/docs/pyboard/tutorial/assembler.rst
index 777600fc86..777600fc86 100644
--- a/docs/tutorial/assembler.rst
+++ b/docs/pyboard/tutorial/assembler.rst
diff --git a/docs/tutorial/debounce.rst b/docs/pyboard/tutorial/debounce.rst
index f730e1d340..f730e1d340 100644
--- a/docs/tutorial/debounce.rst
+++ b/docs/pyboard/tutorial/debounce.rst
diff --git a/docs/tutorial/fading_led.rst b/docs/pyboard/tutorial/fading_led.rst
index 0a4b5c5039..0a4b5c5039 100644
--- a/docs/tutorial/fading_led.rst
+++ b/docs/pyboard/tutorial/fading_led.rst
diff --git a/docs/tutorial/img/fading_leds_breadboard_fritzing.png b/docs/pyboard/tutorial/img/fading_leds_breadboard_fritzing.png
index a8eec4eb62..a8eec4eb62 100644
--- a/docs/tutorial/img/fading_leds_breadboard_fritzing.png
+++ b/docs/pyboard/tutorial/img/fading_leds_breadboard_fritzing.png
Binary files differ
diff --git a/docs/tutorial/img/pyboard_servo.jpg b/docs/pyboard/tutorial/img/pyboard_servo.jpg
index 0d64e46c42..0d64e46c42 100644
--- a/docs/tutorial/img/pyboard_servo.jpg
+++ b/docs/pyboard/tutorial/img/pyboard_servo.jpg
Binary files differ
diff --git a/docs/tutorial/img/pyboard_usb_micro.jpg b/docs/pyboard/tutorial/img/pyboard_usb_micro.jpg
index bc1c2b8323..bc1c2b8323 100644
--- a/docs/tutorial/img/pyboard_usb_micro.jpg
+++ b/docs/pyboard/tutorial/img/pyboard_usb_micro.jpg
Binary files differ
diff --git a/docs/tutorial/img/skin_amp_1.jpg b/docs/pyboard/tutorial/img/skin_amp_1.jpg
index df44460080..df44460080 100644
--- a/docs/tutorial/img/skin_amp_1.jpg
+++ b/docs/pyboard/tutorial/img/skin_amp_1.jpg
Binary files differ
diff --git a/docs/tutorial/img/skin_amp_2.jpg b/docs/pyboard/tutorial/img/skin_amp_2.jpg
index 7631b3b633..7631b3b633 100644
--- a/docs/tutorial/img/skin_amp_2.jpg
+++ b/docs/pyboard/tutorial/img/skin_amp_2.jpg
Binary files differ
diff --git a/docs/tutorial/img/skin_lcd_1.jpg b/docs/pyboard/tutorial/img/skin_lcd_1.jpg
index 1dda73ffd5..1dda73ffd5 100644
--- a/docs/tutorial/img/skin_lcd_1.jpg
+++ b/docs/pyboard/tutorial/img/skin_lcd_1.jpg
Binary files differ
diff --git a/docs/tutorial/img/skin_lcd_2.jpg b/docs/pyboard/tutorial/img/skin_lcd_2.jpg
index 6e3e1033ef..6e3e1033ef 100644
--- a/docs/tutorial/img/skin_lcd_2.jpg
+++ b/docs/pyboard/tutorial/img/skin_lcd_2.jpg
Binary files differ
diff --git a/docs/tutorial/index.rst b/docs/pyboard/tutorial/index.rst
index c134d0deb7..c134d0deb7 100644
--- a/docs/tutorial/index.rst
+++ b/docs/pyboard/tutorial/index.rst
diff --git a/docs/tutorial/intro.rst b/docs/pyboard/tutorial/intro.rst
index fea124459b..fea124459b 100644
--- a/docs/tutorial/intro.rst
+++ b/docs/pyboard/tutorial/intro.rst
diff --git a/docs/tutorial/lcd_skin.rst b/docs/pyboard/tutorial/lcd_skin.rst
index 8ee31d9603..8ee31d9603 100644
--- a/docs/tutorial/lcd_skin.rst
+++ b/docs/pyboard/tutorial/lcd_skin.rst
diff --git a/docs/tutorial/leds.rst b/docs/pyboard/tutorial/leds.rst
index 2105580e8d..2105580e8d 100644
--- a/docs/tutorial/leds.rst
+++ b/docs/pyboard/tutorial/leds.rst
diff --git a/docs/tutorial/pass_through.rst b/docs/pyboard/tutorial/pass_through.rst
index a94e7363d2..a94e7363d2 100644
--- a/docs/tutorial/pass_through.rst
+++ b/docs/pyboard/tutorial/pass_through.rst
diff --git a/docs/tutorial/power_ctrl.rst b/docs/pyboard/tutorial/power_ctrl.rst
index 877b7cd7ee..877b7cd7ee 100644
--- a/docs/tutorial/power_ctrl.rst
+++ b/docs/pyboard/tutorial/power_ctrl.rst
diff --git a/docs/tutorial/repl.rst b/docs/pyboard/tutorial/repl.rst
index 303f035f8d..303f035f8d 100644
--- a/docs/tutorial/repl.rst
+++ b/docs/pyboard/tutorial/repl.rst
diff --git a/docs/tutorial/reset.rst b/docs/pyboard/tutorial/reset.rst
index 0cd5ac21c8..0cd5ac21c8 100644
--- a/docs/tutorial/reset.rst
+++ b/docs/pyboard/tutorial/reset.rst
diff --git a/docs/tutorial/script.rst b/docs/pyboard/tutorial/script.rst
index 011484722c..011484722c 100644
--- a/docs/tutorial/script.rst
+++ b/docs/pyboard/tutorial/script.rst
diff --git a/docs/tutorial/servo.rst b/docs/pyboard/tutorial/servo.rst
index 83d1b0cc15..83d1b0cc15 100644
--- a/docs/tutorial/servo.rst
+++ b/docs/pyboard/tutorial/servo.rst
diff --git a/docs/tutorial/switch.rst b/docs/pyboard/tutorial/switch.rst
index 759fea8ffe..759fea8ffe 100644
--- a/docs/tutorial/switch.rst
+++ b/docs/pyboard/tutorial/switch.rst
diff --git a/docs/tutorial/timer.rst b/docs/pyboard/tutorial/timer.rst
index fee01e17b7..fee01e17b7 100644
--- a/docs/tutorial/timer.rst
+++ b/docs/pyboard/tutorial/timer.rst
diff --git a/docs/tutorial/usb_mouse.rst b/docs/pyboard/tutorial/usb_mouse.rst
index 4c3a85e548..4c3a85e548 100644
--- a/docs/tutorial/usb_mouse.rst
+++ b/docs/pyboard/tutorial/usb_mouse.rst
diff --git a/docs/topindex.html b/docs/topindex.html
index fb1e048d40..a810f61c4f 100644
--- a/docs/topindex.html
+++ b/docs/topindex.html
@@ -8,36 +8,53 @@
v{{ release|e }}{% if last_updated %}, {{ _('last updated') }} {{ last_updated|e }}{% endif %}.
</p>
+ <p>
+ MicroPython runs on a variety of systems and each has their own specific
+ documentation. You are currently viewing the documentation for
+ <strong>{{ port_name }}</strong>.
+ </p>
+
+ <!--p>
+ Documentation for other systems are available:
+ {% for p in all_ports %}
+ <a href="{{ p[1] }}">{{ p[0] }}</a>{% if not loop.last %}, {% endif %}
+ {% endfor %}.
+ </p-->
+
<p><strong>Documentation for Micro Python and the pyboard:</strong></p>
<table class="contentstable"><tr>
<td width="40%" style="padding-left:2em;">
- <p class="biglink">
- <a class="biglink" href="{{ pathto("quickref") }}">Quick reference for the pyboard</a><br/>
- <span class="linkdescr">pinout for the pyboard and snippets of useful code</span>
- </p>
- <p class="biglink">
- <a class="biglink" href="{{ pathto("general") }}">General information about the pyboard</a><br/>
- <span class="linkdescr">read this first for a quick overview</span>
- </p>
- <p class="biglink">
- <a class="biglink" href="{{ pathto("tutorial/index") }}">Tutorials and code examples</a><br/>
- <span class="linkdescr">start here</span>
- </p>
+ {% if port == "pyboard" %}
+ <p class="biglink">
+ <a class="biglink" href="{{ pathto(port + "/quickref") }}">Quick reference for {{ port_name }}</a><br/>
+ <span class="linkdescr">pinout for {{ port_name }} and snippets of useful code</span>
+ </p>
+ <p class="biglink">
+ <a class="biglink" href="{{ pathto(port + "/general") }}">General information about {{ port_name }}</a><br/>
+ <span class="linkdescr">read this first for a quick overview</span>
+ </p>
+ <p class="biglink">
+ <a class="biglink" href="{{ pathto(port + "/tutorial/index") }}">Tutorials and code examples</a><br/>
+ <span class="linkdescr">start here</span>
+ </p>
+ {% endif %}
<p class="biglink">
<a class="biglink" href="{{ pathto("library/index") }}">Library Reference</a><br/>
<span class="linkdescr">Micro Python libraries, including the <a href="{{ pathto("library/pyb") }}">pyb module</a></span>
</p>
</td>
<td width="40%" style="padding-left:2em;">
- <p class="biglink">
- <a class="biglink" href="{{ pathto("hardware/index") }}">The pyboard hardware</a><br/>
- <span class="linkdescr">schematics, dimensions and component datasheets</span>
- </p>
- <p class="biglink">
- <a class="biglink" href="http://micropython.org/resources/Micro-Python-Windows-setup.pdf">Guide for pyboard on Windows (PDF)</a><br/>
- <span class="linkdescr">including DFU programming</span>
- </p>
+ {% if port == "pyboard" %}
+ <p class="biglink">
+ <a class="biglink" href="{{ pathto(port + "/hardware/index") }}">The {{ port }} hardware</a><br/>
+ <span class="linkdescr">schematics, dimensions and component datasheets</span>
+ </p>
+ <p class="biglink">
+ <a class="biglink" href="http://micropython.org/resources/Micro-Python-Windows-setup.pdf">Guide for {{ port_name }} on Windows (PDF)</a><br/>
+ <span class="linkdescr">including DFU programming</span>
+ </p>
+ {% endif %}
<p class="biglink">
<a class="biglink" href="{{ pathto("license") }}">License</a><br/>
<span class="linkdescr">Micro Python license information</span>
@@ -62,10 +79,6 @@
<a class="biglink" href="{{ pathto("contents") }}">Table of contents</a><br/>
<span class="linkdescr">a list of all sections and subsections</span>
</p>
- <p class="biglink">
- <a class="biglink" href="{{ pathto("search") }}">Search page</a><br/>
- <span class="linkdescr">search this documentation</span>
- </p>
</td></tr>
</table>