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

Consistent and semantic CSS for signatures #4390

Closed
timhoffm opened this issue Jan 7, 2018 · 1 comment
Closed

Consistent and semantic CSS for signatures #4390

timhoffm opened this issue Jan 7, 2018 · 1 comment
Labels
builder:html type:proposal a feature suggestion
Milestone

Comments

@timhoffm
Copy link
Contributor

timhoffm commented Jan 7, 2018

Subject: Consistent and semantic CSS for signatures

I propse to introduce a consistent set of semantic CSS classes for easier styling of the signature.

Current state

Example signature:

Axes. vlines ( x, y, linestyles='solid' )

The corresponding HTML looks like this:

<dt id="matplotlib.axes.Axes.vlines">
<code class="descclassname">Axes.</code>
<code class="descname">vlines</code>
<span class="sig-paren">(</span>
<em>x</em>, <em>y</em>, <em>linestyles='solid'</em>
<span class="sig-paren">)</span>

Proposed change

Use this set of semantic CSS classes:

  • sig
    • sig-prename
    • sig-name
    • sig-paren
    • sig-param

These could simply be added to maintain compatibility with existing CSS files:

<dt id="matplotlib.axes.Axes.vlines" class="sig">
<code class="sig-prename descclassname">Axes.</code>
<code class="sig-name descname">vlines</code>
<span class="sig-paren">(</span>
<em class="sig-param">x</em>, <em class="sig-param">y</em>, <em class="sig-param">linestyles='solid'</em>
<span class="sig-paren">)</span>

In the long run descclassname and descname could be deprecated. Also one could debate if one should change the tags <code> and <em> to <span>, but I have no strong opinion on this.

This scheme can be extend when more complex signatures arise, as proposed in #4289. For example one could add classes sig-paramname and sig-paramvalue.

@tk0miya
Copy link
Member

tk0miya commented May 29, 2019

Fixed by #4390.
Thanks,

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
builder:html type:proposal a feature suggestion
Projects
None yet
Development

No branches or pull requests

2 participants