Python and sphinx: bullet point list in multiline google style docstring
You can break the bulleted line as you like. Just line up the continuation with the previous lines text like:
- give a visual representation of that geography
- give a visual representation of the distance matrix
- give a visual representation of a configuration, a configuration being the
repartition of some or all cities in pools
Solution from @Stephen Rauch was the perfect one. I just wanted to add that it also works for non bulleted lists. I had a similar issue with comments for arguments of functions or methods. For example:
def permute_array(arr, seq):
""" Function to "square permute" a 2D array
This function's purpose is to enable distance matrices permutations. That
is, for example, permute both lines and columns of the array so as to
reorder a distance matrix.
Args:
arr (numpy array): the array to permute. It should be square of size n.
seq (iterable of int): a permutation of range(n) (should be of length n and contain every integer from 0 to n-1)
Last line is way too long.
However, a "same indentation level" line break just breaks the nice sphinx method documentation:
Args:
arr (numpy array): the array to permute. It should be square of size n.
seq (iterable of int): a permutation of range(n) (should be of length n
and contain every integer from 0 to n-1)
Badly built documentation
But, breaking the line with an identation just works fine.
Args:
arr (numpy array): the array to permute. It should be square of size n.
seq (iterable of int): a permutation of range(n) (should be of length n
and contain every integer from 0 to n-1)
Nicely built documentation