-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Docstring formatting information/examples #95
Comments
I certainly can!
Re: linking relevant documentation: This would be quite a tedious undertaking to do so. It would also likely require a dedicated readthedocs page (which is likely coming soon for configuration alone) for the project. I would welcome if someone wants to take it on but I don't have the bandwidth to do so right now. To be completely honest, I don't see the benefit out weighing the time investment in documenting/cross referencing every aspect of ReStructuredText+Sphinx that this project formats. Now, I'm not ruling it out completely as this project has seen more activity in the last month than nearly its entire history. However, I'd rather cite/explain things ad-hoc as they come up (this could later be compiled into a doc if there's demand for it) than to document everything outright all at once. |
Makes sense, I totally get the lack of bandwidth! I also get the tediousness of linking a bunch of different references for the formatting choices. Alternatively, a few sample docstrings would really go a long way in communicating what to expect. I can make a PR with a few samples if you want, since I am toying around with it in a personal project right now and can easily convert some formatted docstrings into samples.
I don't think it is incorrect in this instance, although I didn't even know From PEP 484, As far as using |
Can you provide information about how docstrings are formatted when a Python file is given to docstrfmt?
Things I have noticed that surprised me so far:
The first line of a multi-line docstring (the summary line) does not get split to multiple lines if it goes over the line length limit, but other lines will be reformatted. This kind of makes sense because PEP 257 says that the summary line should fit on one line, but looks like a bug to anyone not familiar with it. (I'm still not sure if it is a bug or not, honestly)
Function parameter documentation like:
is compacted to
which I didn't even realize was possible! It was hard to find where this compact format was defined (here, I think) in the Sphinx documentation, so I was initially suspicious of whether it was actually part of the Sphinx format. Links to the formatting guide and/or formatted samples would be incredibly useful in clearing up things like this.
The text was updated successfully, but these errors were encountered: