Skip to content

Commit

Permalink
feat: Add doc-signature CSS class to separate signature code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Aug 27, 2023
1 parent 8f0ade2 commit b6c648f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/mkdocstrings_handlers/python/rendering.py
Expand Up @@ -104,7 +104,14 @@ def do_format_signature(
template = env.get_template("signature.html")
signature = template.render(context.parent, function=function)
signature = _format_signature(callable_path, signature, line_length)
return str(env.filters["highlight"](signature, language="python", inline=False))
return str(
env.filters["highlight"](
signature,
language="python",
inline=False,
classes=["doc-signature"],
),
)


@pass_context
Expand Down Expand Up @@ -142,6 +149,7 @@ def do_format_attribute(
Markup.escape(signature),
language="python",
inline=False,
classes=["doc-signature"],
),
)

Expand Down

0 comments on commit b6c648f

Please sign in to comment.