-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Add support for alternative section names in Google docstrings #489
Add support for alternative section names in Google docstrings #489
Conversation
Thanks for the PR! I could see some people being surprised that their sections are renamed by pdoc. Would it make more sense to add those alternatives to |
It definitely would; I went for this approach because currently the function also remaps |
That's actually a fair point. Let's use "Arguments" for everything as you suggested and see if someone complains. While we're at it, would it make sense to add (also please add a changelog entry, thanks!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks! 🍰
This PR adds support for specifying alternative section names in Google docstrings that are to be interpreted as sections-of-lists, similarly to the standard "Args" section. Right now the PR aliases "Parameters" and "Params" to "Args"; these names are not standard but are often seen in the wild, especially in codebases that mix NumPy and Google-style docstrings (NumPy uses "Parameters" by default).
The PR could also partially fix the issue raised in #466 if we decided to add "Keyword Arguments" and "Keyword Args" such that "Keyword Args" is handled as-is and "Keyword Arguments" is aliased to "Keyword Args". That would require an additional commit that I'm happy to do if the maintainer agrees with the general direction of this PR.