jgillis edited this page Feb 3, 2015 · 4 revisions

Snippets of python code + output in the API intend to make CasADi project more accessible. An example can be seen in the API docs.

It is very easy for users to add such snippets: once you locate the correct Doxygen lines, use the following syntax to add code:

/** \brief foo

    print 123
    print SX.sym("x")
void foo();

Note: no '*' symbols in the lines with the doctests.

The code will be formatted nicely in the api docs, and, more crucially will end up (*) in the Python docstrings as:

>>> print 123
>>> print SX.sym("x")

This is unittested as python -m doctests -v by casadibot every night

(*) casadibot does this with make doxexport in docs/api