I'm trying to generate documentation using pdoc, where my docstrings look like this:
"""
I am a description of what a method does
:param param1: an integer
:param param2: a str
"""
I found this question: How to preserve line breaks when generating python docs using sphinx but the suggestion of prefixing each line with | did not work for me (it just showed up like this)
| :param param1: an integer | :param param2: a str
any ideas short of using \n at the end of every line?
pdoc
? -- Also what happens if you move the first line up a line (e.g."""I am a ...
)? That's the style recommended by PEP 257 so most tools that do docstring parsing should understand it. – Schleswigholsteinpdoc
to use reStructuredText the same way you would tellepydoc
? e.g. add__docformat__ = 'restructuredtext en'
at the top of the module? – Schleswigholstein:param: an integer
and:param: a string
. And if that doesn't work (with the__docformat__
above, you could try the epydoc format:@type param1: int
(newline)@param param1: Somthing about the integer here.
-- Of course, you maybe already know this since you're trying to find a way to preserve newlines -- But I figured I'd point it out just in case. – Schleswigholstein@param param1:
instead of:param param1:
(which is what I was really doing, copied it wrong, will update) didn't make a difference – Serles