sphinx-doc / sphinx-doc/sphinx
napoleon_custom_sections add css class with section name
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
Hi, there are two display styles of napoleon_custom_sections - params_style and return_style.
My issue is that in return_style if i use python dictionary in it, on first key value pair the dot is replaced with two dashes (otherwise do exactly what i want)

If i use just custom section not as tuple, but just as list, then it's not formatted.

I could use own CSS, but problem is, that i cannot identify what my section is.
I understand that it's not possible to add more and more custom sections, but is it possible to add class to the element, so i can format it?

So in last image there is extra class with name of my section so i can use it in my CSS as .rubric .mysection
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the napoleon_custom_sections handling for return_style and params_style, then inspect how custom sections are rendered into HTML. Confirm the desired behavior from the examples: a section-specific CSS class should be present so selectors such as .rubric .mysection can target it without changing existing formatting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100