Closed benjello closed 3 years ago
Hey @benjello ,
The right place to handle these entries would be in SphinxProcesssor. How would you have that parameter be rendered as Markdown?
Hi Niklas,
I just stumbled across this too. I would propose to do it similar to sphinx.
Sphinx docstring style is the following: :param [ParamName]: [ParamDescription](, defaults to [DefaultParamVal]) :type [ParamName]: [ParamType](, optional)
... becomes to
(the ", defaults to ... " is just appended as it is, so this needs no care)
In Markdown you could do just the same, like:
metadata
(dict, optional): additional metadata to describe the object:return: [ReturnDescription] :rtype: [ReturnType]
becomes to
Returns: [ReturnDescription] Return type: [ReturnType]
Like this or just
Returns ([ReturnType]): description...
like
Returns (dict): description...
would be great in my opinion :)
source: https://dev.to/zenulabidin/sphinx-docstring-best-practices-2fca
Hey @suitre77 , I like what you're proposing:
Returns ([ReturnType]): description...
This will just need some work in the SphinxProcessor
to understand content from multiple lines and summarize it into a single line. Not sure when I'll get to it, but it's high up on my list.
Heym @suitre77, I made it so that the following docstring:
:param foo: A foo value
:type foo: str
:type bar: int
:param bar: A bar value
:returns: Some eggs from foo and bar
:rtype: str
is rendered as
Arguments:
foo
(str
): A foo value
bar
(int
): A bar valueReturns:
str
: Some eggs from foo and bar
v3.12.0
appreciating, thanks :)
Thank you for this neat piece of software.
Is there a way to tell the sphinx processor to deal with
:type :
and:rtype :
entries like those presents in here ?