Browse Source

docs: Generate a separate docs build for each port.

Using Damien's approach where conf.py and topindex.html are
shared by all ports.
pull/1318/head
Daniel Campora 10 years ago
committed by Damien George
parent
commit
7ca1bd314b
  1. 22
      docs/conf.py
  2. 25
      docs/contents.rst
  3. 28
      docs/index.rst
  4. 0
      docs/pyboard/general.rst
  5. 0
      docs/pyboard/hardware/index.rst
  6. 0
      docs/pyboard/quickref.rst
  7. 0
      docs/pyboard/tutorial/accel.rst
  8. 0
      docs/pyboard/tutorial/amp_skin.rst
  9. 0
      docs/pyboard/tutorial/assembler.rst
  10. 0
      docs/pyboard/tutorial/debounce.rst
  11. 0
      docs/pyboard/tutorial/fading_led.rst
  12. 0
      docs/pyboard/tutorial/img/fading_leds_breadboard_fritzing.png
  13. 0
      docs/pyboard/tutorial/img/pyboard_servo.jpg
  14. 0
      docs/pyboard/tutorial/img/pyboard_usb_micro.jpg
  15. 0
      docs/pyboard/tutorial/img/skin_amp_1.jpg
  16. 0
      docs/pyboard/tutorial/img/skin_amp_2.jpg
  17. 0
      docs/pyboard/tutorial/img/skin_lcd_1.jpg
  18. 0
      docs/pyboard/tutorial/img/skin_lcd_2.jpg
  19. 0
      docs/pyboard/tutorial/index.rst
  20. 0
      docs/pyboard/tutorial/intro.rst
  21. 0
      docs/pyboard/tutorial/lcd_skin.rst
  22. 0
      docs/pyboard/tutorial/leds.rst
  23. 0
      docs/pyboard/tutorial/pass_through.rst
  24. 0
      docs/pyboard/tutorial/power_ctrl.rst
  25. 0
      docs/pyboard/tutorial/repl.rst
  26. 0
      docs/pyboard/tutorial/reset.rst
  27. 0
      docs/pyboard/tutorial/script.rst
  28. 0
      docs/pyboard/tutorial/servo.rst
  29. 0
      docs/pyboard/tutorial/switch.rst
  30. 0
      docs/pyboard/tutorial/timer.rst
  31. 0
      docs/pyboard/tutorial/usb_mouse.rst
  32. 61
      docs/topindex.html

22
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()],
}

25
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

28
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
==================

0
docs/general.rst → docs/pyboard/general.rst

0
docs/hardware/index.rst → docs/pyboard/hardware/index.rst

0
docs/quickref.rst → docs/pyboard/quickref.rst

0
docs/tutorial/accel.rst → docs/pyboard/tutorial/accel.rst

0
docs/tutorial/amp_skin.rst → docs/pyboard/tutorial/amp_skin.rst

0
docs/tutorial/assembler.rst → docs/pyboard/tutorial/assembler.rst

0
docs/tutorial/debounce.rst → docs/pyboard/tutorial/debounce.rst

0
docs/tutorial/fading_led.rst → docs/pyboard/tutorial/fading_led.rst

0
docs/tutorial/img/fading_leds_breadboard_fritzing.png → docs/pyboard/tutorial/img/fading_leds_breadboard_fritzing.png

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

0
docs/tutorial/img/pyboard_servo.jpg → docs/pyboard/tutorial/img/pyboard_servo.jpg

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

0
docs/tutorial/img/pyboard_usb_micro.jpg → docs/pyboard/tutorial/img/pyboard_usb_micro.jpg

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 85 KiB

0
docs/tutorial/img/skin_amp_1.jpg → docs/pyboard/tutorial/img/skin_amp_1.jpg

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 82 KiB

0
docs/tutorial/img/skin_amp_2.jpg → docs/pyboard/tutorial/img/skin_amp_2.jpg

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 73 KiB

0
docs/tutorial/img/skin_lcd_1.jpg → docs/pyboard/tutorial/img/skin_lcd_1.jpg

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

0
docs/tutorial/img/skin_lcd_2.jpg → docs/pyboard/tutorial/img/skin_lcd_2.jpg

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

0
docs/tutorial/index.rst → docs/pyboard/tutorial/index.rst

0
docs/tutorial/intro.rst → docs/pyboard/tutorial/intro.rst

0
docs/tutorial/lcd_skin.rst → docs/pyboard/tutorial/lcd_skin.rst

0
docs/tutorial/leds.rst → docs/pyboard/tutorial/leds.rst

0
docs/tutorial/pass_through.rst → docs/pyboard/tutorial/pass_through.rst

0
docs/tutorial/power_ctrl.rst → docs/pyboard/tutorial/power_ctrl.rst

0
docs/tutorial/repl.rst → docs/pyboard/tutorial/repl.rst

0
docs/tutorial/reset.rst → docs/pyboard/tutorial/reset.rst

0
docs/tutorial/script.rst → docs/pyboard/tutorial/script.rst

0
docs/tutorial/servo.rst → docs/pyboard/tutorial/servo.rst

0
docs/tutorial/switch.rst → docs/pyboard/tutorial/switch.rst

0
docs/tutorial/timer.rst → docs/pyboard/tutorial/timer.rst

0
docs/tutorial/usb_mouse.rst → docs/pyboard/tutorial/usb_mouse.rst

61
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>

Loading…
Cancel
Save