Add python documentation
Created by: gcarleo
As we move towards alpha/beta release for version 2.0, we need to have complete documentation for the new python functions.
The idea is to use the nice parser developed by @ooreilly here . This parser + some markdown templates will be used to automatically generate the files for the docs website of the site, here.
To do so, the python functions exposed through pybind11 should support a minimally modified version of the google-style docstrings.
A simple function with signature
operation(self: python_example.Operations, i: int, j: int, op_name: str='add') -> int
would have an associated docstring:
A function performing one of the allowed operations between two integers.
Args:
i (int): The first parameter.
j (int): The second parameter.
op_name (str='add'): The type of operation.
Returns:
int: If op_name=='add' it perform the sum param1+param2, otherwise 0.
Help is welcome to add documentation following this style, once we finalize the parser bit.
One can add docstrings to pybind11 functions like this:
m.def("operation", &operation, R"EOF(
A function performing one of the allowed operations between two integers.
Args:
i (int): The first parameter.
j (int): The second parameter.
op_name (str='add'): The type of operation.
Returns:
int: If op_name=='add' it perform the sum param1+param2, otherwise 0.
)EOF");