Commit bba5bc7c by Benoit Bryon

Added doctests in documentation guidelines.

parent f78b058c
...@@ -126,6 +126,43 @@ Export documentation to HTML ...@@ -126,6 +126,43 @@ Export documentation to HTML
* HTML documentation is exported to docs/_build/html/. * HTML documentation is exported to docs/_build/html/.
*************
Use doctests!
*************
This documentation uses the `Sphinx's doctest extension`_.
Write doctests
==============
Here is a RST code sample to write doctests. You can find some doctests in
:doc:`/reference/terrain`.
.. highlight:: rst
::
.. highlight:: python
.. doctest::
>>> print "Hello world!"
Hello world!
See `Sphinx's doctest extension`_ and `Python's doctest`_ documentations for
details.
Run doctests
============
Go to lettuce folder and use the provided Makefile:
.. highlight:: sh
::
make doctests
********** **********
References References
********** **********
...@@ -134,3 +171,5 @@ References ...@@ -134,3 +171,5 @@ References
.. _`Python-sphinx`: http://sphinx.pocoo.org/ .. _`Python-sphinx`: http://sphinx.pocoo.org/
.. _`reStructuredText`: http://docutils.sourceforge.net/rst.html .. _`reStructuredText`: http://docutils.sourceforge.net/rst.html
.. _`Sphinx's doctest extension`: http://sphinx.pocoo.org/ext/doctest.html#module-sphinx.ext.doctest
.. _`Python's doctest`: http://docs.python.org/library/doctest.html
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment