10000 More fine-grained highlighting of parameters in function signatures · Issue #6417 · sphinx-doc/sphinx · GitHub
[go: up one dir, main page]

Skip to content
More fine-grained highlighting of parameters in function signatures #6417
@timhoffm

Description

@timhoffm

Parameters in function signatures are currently parsed to a single html element such as
<em class="sig-param">myparam=4</em>

It would be nice to split this down further into classed spans, so that we could highlight different parts of the parameters separately. For example:

<em class="sig-param">
<span class="sig-param-name">myparam</span>=<span class="sig-param-value">4</span>
</em>

(line breaks only for better readability. Actual code wound not have linebreaks as they would result in whitespace in the rendered HTML.)

Things to consider:

  • This requires further splitting at the parser level.
  • Maybe even add a class for =?
  • Type annotations could be considered as well, as a separate span.

This is a follow-up on #4390/#6401 and #5868.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0