Skip to content

Parameters and Returns headings are not visible #17

Closed

Description

@francois-rozet

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.

Activity

  1. pawamoy commented on Apr 17, 2022

    @pawamoy
    Member

    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 🙂

  2. francois-rozet commented on Apr 17, 2022

    @francois-rozet
    Author

    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.

  3. pawamoy commented on Apr 17, 2022

    @pawamoy
    Member

    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 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions