Skip to content
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

Close #8573: napoleon: Add more custom section styles #8658

Merged
merged 1 commit into from
Jan 19, 2021

Conversation

SolidifiedRay
Copy link
Contributor

@SolidifiedRay SolidifiedRay commented Jan 5, 2021

Subject: add more custom section styles

Feature or Bugfix

  • Feature

Purpose

napoleon_custom_sections option does not allow to configure the style, and the default style is inconsistent with the rest of the doc. It will be nice if we can choose between a few more styles. This new feature add two more styles that can make the custom section more consistent with the Parameter section or the Return section.
Behavior:
napoleon_custom_sections = [('Custom Section', 'params_style')]
or
napoleon_custom_sections = [('Custom Section', 'returns_style')]

Detail

  • The default style is inconsistent
    default

  • Display like the parameter section
    para

  • Display like the return section
    return

Relates

Copy link
Member

@tk0miya tk0miya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add testcases for new behavior?

sphinx/ext/napoleon/__init__.py Outdated Show resolved Hide resolved
sphinx/ext/napoleon/__init__.py Outdated Show resolved Hide resolved
@SolidifiedRay
Copy link
Contributor Author

Hi @tk0miya, I have added the tests, changed the name, and updated the doc. Thank you for the review!

Copy link
Member

@tk0miya tk0miya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with nits!

doc/usage/extensions/napoleon.rst Outdated Show resolved Hide resolved
doc/usage/extensions/napoleon.rst Outdated Show resolved Hide resolved
@SolidifiedRay
Copy link
Contributor Author

SolidifiedRay commented Jan 18, 2021

I have fixed the nits, but the CircleCI tests failed after the changes. I only edited some lines inside napoleon.rst, and the error message seems irrelevant to my code. Could you help me have a look at it? Thanks! @tk0miya

@tk0miya tk0miya merged commit ca06770 into sphinx-doc:3.x Jan 19, 2021
@tk0miya
Copy link
Member

tk0miya commented Jan 19, 2021

Merged. Thank you for your contribution!

Note: I manually re-ran the testcase and confirmed all tests passed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
extensions:napoleon type:enhancement enhance or introduce a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants