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
Napoleon: more custom docstring section styles #8573
Comments
Boy, I could really use this right away. If it were up to me:
That would be a backwards-incompatible change, but you could argue that the current behavior isn’t actually documented in the Sphinx docs, and thus is fair game. Cheers, |
I also don't know napoleon module has such option. It was added at #4387. It has not been documented, but it was introduced in CHANGES. So I consider it's a secret feature. So -1 for incompatible change. But I'm interested in the enhancement itself. Could you submit a PR please? I'll take a look. |
Close #8573: napoleon: Add more custom section styles
Although the
napoleon_custom_sections
option help renders custom docstring section, the style is inconsistent with the rest of the doc.For example, I have a custom docstring section
Side Effect
. I would like it to be displayed asreturns
orparameters
docstring section. However,napoleon_custom_sections
option rendesrSide Effect
in a different style shown in the following picture.It will be really helpful if we can customize the custom sections a bit more. The following setting has a similar effect, but it renders the Parameters name instead of the custom name.
I would like to do something like the following so that my Custom section has the same style as the Parameter section, and it still keeps my custom name:
or
The following link includes more details about the solutions:
Format custom "Side Effects" docstring section in-toto/in-toto#401
Others people have expressed a similar desire (see sphinx-contrib/napoleon#2)
If you are interested, I would like to provide a PR for this. Thanks!
The text was updated successfully, but these errors were encountered: