Sphinx can useconsolidated fields with mixed results.
The first example is traditional Sphinx with some extra glitz.
Return the maximum speed for a fox.
Parameters: |
|
---|---|
Returns: |
|
It was autodoc’d from this docstrings:
deffoxy(size,weight,age):""" Return the maximum speed for a fox. :parameter size: The size of the fox (in meters) :parameter weight: The weight of the fox (in stones) :type weight: float :parameter age: The age of the fox (in years) :type age: int :returns: - **velocity** (`float`) -- The velocity of the fox. :rtype: `float` """returnsize/age
The second and third examples are consolidated fields. The second uses bulletsand the third indentation.
Return the maximum speed for a fox.
Parameters: |
---|
The size of the fox (in meters)
The weight of the fox (in stones)
The age of the fox (in years)
Returns: |
---|
The velocity of the fox.
Personally I like the indented version, it reads well, and also formats well insphinx, except the arguments are not boldface, although the arg types areitalicized.
Return the maximum speed for a fox.
Parameters: |
|
---|---|
Returns: | speedThe speed of the fox. |
Which corresponds to these docstrings:
deffox_velocity(size,weight,age):""" Return the maximum speed for a fox. :Parameters: - `size`: The size of the fox (in meters) - `weight`: The weight of the fox (in stones) - `age`: The age of the fox (in years) :Returns: - `velocity`: The velocity of the fox. """returnsize/agedeffox_speed(size,weight,age):""" Return the maximum speed for a fox. :Parameters: size The size of the fox (in meters) weight : float The weight of the fox (in stones) age : int The age of the fox (in years) :Returns: speed : float The speed of the fox. """returnsize/age
NumPyDoc vs. Sphinx and Google Format
Enter search terms or a module, class or function name.