morse-simulator/morse — pull request #482 by severin-lemaignan (2014-01-23 22:37:55+00:00)
Title: [doc] Add support for custom code examples

This commit adds 2 features to the documentation generation tool:
- components can use one or several 'example' blocks in the docstring
to provide custom examples. For instance:

"""
My nice component...
gngngn

.. example::
from morse.builder import *
toto = Toto()
...

gngngng
Blabla
"""

Such examples are automatically moved to the 'Examples' section.

- it also add the :noautoexample: role to prevent the automatic
generation of a code sample (which sometimes does not make sense
at all). This role can be used anywhere in the module docstring.

These changes are demonstrated on the ArmatureSensor.