Skip to content

Commit

Permalink
docs: Add initial draft documentation for the WiPy.
Browse files Browse the repository at this point in the history
This makes all common files "port-aware" using the .. only directive.
  • Loading branch information
Daniel Campora committed Jun 10, 2015
1 parent b630de1 commit cfcf47c
Show file tree
Hide file tree
Showing 33 changed files with 2,230 additions and 910 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ preferably in a virtualenv:

In `micropython/docs`, build the docs:

make html
make MICROPY_PORT=<port_name> BUILDDIR=<port_name>/build html

You'll find the index page at `micropython/docs/build/html/index.html`.
Where ``<port_name>`` can be ``port_unix``, ``port_pyboard``, ``port_wipy`` or ``port_esp8266``.

You'll find the index page at `micropython/docs/<port_name>/build/html/index.html`.
8 changes: 7 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'
#master_doc = 'index'

# General information about the project.
project = 'MicroPython'
Expand Down Expand Up @@ -297,3 +297,9 @@
'port_name':ports[micropy_port],
'all_ports':[(n, url_prefix + p) for p, n in ports.items()],
}

# Append the other ports' specific folders/files to the exclude pattern
exclude_patterns.extend([port + '*' for port in ports if port != micropy_port])

# Specify a custom master document based on the port name
master_doc = micropy_port + '_' + 'index'
20 changes: 0 additions & 20 deletions docs/contents.rst

This file was deleted.

7 changes: 7 additions & 0 deletions docs/esp8266_contents.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
MicroPython documentation contents
==================================

.. toctree::

library/index.rst
license.rst
15 changes: 15 additions & 0 deletions docs/esp8266_index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
MicroPython documentation and references
========================================

.. toctree::

library/index.rst
license.rst
esp8266_contents.rst

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
29 changes: 0 additions & 29 deletions docs/index.rst

This file was deleted.

110 changes: 77 additions & 33 deletions docs/library/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,30 @@ The following standard Python libraries are built in to MicroPython.
For additional libraries, please download them from the `micropython-lib repository
<https://github.com/micropython/micropython-lib>`_.

.. toctree::
:maxdepth: 1
.. only:: port_pyboard

.. toctree::
:maxdepth: 1

cmath.rst
gc.rst
math.rst
os.rst
select.rst
struct.rst
sys.rst
time.rst

.. only:: port_wipy

cmath.rst
gc.rst
math.rst
os.rst
select.rst
struct.rst
sys.rst
time.rst
.. toctree::
:maxdepth: 1
gc.rst
os.rst
select.rst
sys.rst
time.rst

Python micro-libraries
----------------------
Expand All @@ -43,37 +56,68 @@ For example, ``import json`` will first search for a file ``json.py`` or
directory ``json`` and load that package if it is found. If nothing is found,
it will fallback to loading the built-in ``ujson`` module.

.. toctree::
:maxdepth: 1
.. only:: port_pyboard

ubinascii.rst
uctypes.rst
uhashlib.rst
uheapq.rst
ujson.rst
ure.rst
usocket.rst
uzlib.rst
.. toctree::
:maxdepth: 1

ubinascii.rst
uctypes.rst
uhashlib.rst
uheapq.rst
ujson.rst
ure.rst
usocket.rst
uzlib.rst

Libraries specific to the pyboard
---------------------------------
.. only:: port_pyboard

The following libraries are specific to the pyboard.
Libraries specific to the pyboard
---------------------------------

The following libraries are specific to the pyboard.

.. toctree::
:maxdepth: 2

pyb.rst
network.rst

.. toctree::
:maxdepth: 2
.. only:: port_wipy

.. toctree::
:maxdepth: 1

ubinascii.rst
uhashlib.rst
uheapq.rst
ujson.rst
ure.rst
usocket.rst

.. only:: port_wipy

Libraries specific to the WiPy
---------------------------------

The following libraries are specific to the WiPy.

.. toctree::
:maxdepth: 2

pyb.rst
network.rst

pyb.rst
network.rst

.. only:: port_esp8266

Libraries specific to the ESP8266
---------------------------------
Libraries specific to the ESP8266
---------------------------------

The following libraries are specific to the ESP8266.
The following libraries are specific to the ESP8266.

.. toctree::
:maxdepth: 2
.. toctree::
:maxdepth: 2

esp.rst
pyb.rst
esp.rst
36 changes: 19 additions & 17 deletions docs/library/micropython.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,25 @@
Functions
---------

.. function:: mem_info([verbose])

Print information about currently used memory. If the ``verbose`` argument
is given then extra information is printed.

The information that is printed is implementation dependent, but currently
includes the amount of stack and heap used. In verbose mode it prints out
the entire heap indicating which blocks are used and which are free.

.. function:: qstr_info([verbose])

Print information about currently interned strings. If the ``verbose``
argument is given then extra information is printed.

The information that is printed is implementation dependent, but currently
includes the number of interned strings and the amount of RAM they use. In
verbose mode it prints out the names of all RAM-interned strings.
.. only:: port_pyboard or port_unix

.. function:: mem_info([verbose])

Print information about currently used memory. If the ``verbose`` argument
is given then extra information is printed.

The information that is printed is implementation dependent, but currently
includes the amount of stack and heap used. In verbose mode it prints out
the entire heap indicating which blocks are used and which are free.

.. function:: qstr_info([verbose])

Print information about currently interned strings. If the ``verbose``
argument is given then extra information is printed.

The information that is printed is implementation dependent, but currently
includes the number of interned strings and the amount of RAM they use. In
verbose mode it prints out the names of all RAM-interned strings.

.. function:: alloc_emergency_exception_buf(size)

Expand Down
Loading

0 comments on commit cfcf47c

Please sign in to comment.