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

Parameters and Returns headings are not visible #17

Closed
francois-rozet opened this issue Apr 16, 2022 · 3 comments
Closed

Parameters and Returns headings are not visible #17

francois-rozet opened this issue Apr 16, 2022 · 3 comments
Labels
feature New feature or request

Comments

@francois-rozet
Copy link

francois-rozet commented Apr 16, 2022

Is your feature request related to a problem? Please describe.

"Parameters" and "Returns" headings are simple HTML paragraphes without any CSS class. They currently just look like plain text and there is no way to style them.

Describe the solution you'd like

The easiest solution is to assign a CSS class to these headings such that we can style them arbitrarily.
Additionally, it would be better if they were actual HTML headings (and we could choose the level).
The colons also look rather unpolished.

@pawamoy
Copy link
Member

pawamoy commented Apr 17, 2022

Would you like to send a PR? You'd need to update this

<p><strong>{{ section.title or "Parameters:" }}</strong></p>

to something like <span class="doc-section-title"> instead of <strong> (in every docstring template of course).
We can also drop the colons and add a CSS rule in the recommended style (in the docs), like .doc-section-title::after { content: ":"; } (though I think it will need an update in Griffe since it returns sections titles with the trailing colon).

As for making headings of these titles, I'm a bit against it (it would pollute the ToC IMO, and headings levels are quite limited: 5 max, with category headings enabled it will start to look bad with depth-2 objects). I'm still open to discussion of course 🙂

@francois-rozet
Copy link
Author

francois-rozet commented Apr 17, 2022

Sure, I'll try to do that. By the way, currently there is not even <strong> around the "Parameters" and "Returns" if the section style is list.

@pawamoy
Copy link
Member

pawamoy commented Apr 17, 2022

Yeah there are probably discrepancies between all the different sections, sections styles and themes. I should probably start to create tables like the Griffe ones (https://mkdocstrings.github.io/griffe/docstrings/) to keep track of everything. Feel free to harmonize things when/if you send a PR 🙂

@pawamoy pawamoy added the feature New feature or request label Mar 5, 2023
pawamoy added a commit that referenced this issue Apr 12, 2024
@pawamoy pawamoy closed this as completed Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants