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

Napoleon extension has unused code for a "Usage" section #13254

Open
cmarqu opened this issue Jan 19, 2025 · 0 comments
Open

Napoleon extension has unused code for a "Usage" section #13254

cmarqu opened this issue Jan 19, 2025 · 0 comments
Labels

Comments

@cmarqu
Copy link
Contributor

cmarqu commented Jan 19, 2025

Describe the bug

The section name "Usage" does not appear in https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html#docstring-sections
but apparently there is unused code for it:

def _consume_usage_section(self) -> list[str]:
lines = self._dedent(self._consume_to_next_section())
return lines

def _parse_usage_section(self, section: str) -> list[str]:
header = ['.. rubric:: Usage:', '']
block = ['.. code-block:: python', '']
lines = self._consume_usage_section()
lines = self._indent(lines, 3)
return header + block + lines + ['']

All the other _parse_*_section methods are called in the code starting at

self._sections: dict[str, Callable[..., list[str]]] = {

How to Reproduce

Browsing and grepping code.

Environment Information

This is in current Sphinx 8.1.3.

Sphinx extensions

napoleon

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant