Closed csm10495 closed 3 years ago
HTML doesn't really care about newlines. Currently no provisions to replace '\n'
with '<br>'
(i.e. line breaks) for HTML output.
Can you show an example docstring that doesn't look right?
Sure: https://www.github.com/csm10495/pynom/tree/master/pynom%2Fpynom.py look for the init of PyNom.
Then the docs are here: https://csm10495.github.io/pynom/pynom.html
The newlines weren't preserved in the docstrings which made them look kind of weird compared to the original source code.
Well, there's no indication anywhere in the docs that pdoc should preserve newlines. Pdoc3 supports Numpydoc and Google docstring formats as well as raw Markdown, but no <pre>
.
If you care to format your docstrings a little more nicely, following e.g. the Google style guide which results in similar to what you already have, they should render better.
Edit: You can also end your lines with two spaces, which forces Markdown to keep the line break that follows.
Alternatively, you're welcome to edit your html.mako template and wrap docstrings in <pre>
tags.
Is there a flag/setting to preserve Whitespace within multiline docstrings? Right now my multiline docstrings appear to have their newlines lost in translation to html.
Thanks.