Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c03b630

Browse files
committed
Move inline CSS to an external file.
Some of these style options are invalid, or the defaults, so they were dropped entirely. Otherwise, this is roughly equivalent. Fixes #48.
1 parent 370cafa commit c03b630

3 files changed

Lines changed: 31 additions & 15 deletions

File tree

docs/source/_static/custom.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
table#packages tr th {
2+
padding-top: 3em;
3+
padding-bottom: 1em;
4+
}
5+
6+
table#packages tr td {
7+
vertical-align: top;
8+
}
9+
10+
table#packages tr td a img {
11+
height: 1.4em;
12+
max-width: none;
13+
}

docs/source/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
},
4141
],
4242
}
43+
html_css_files = [
44+
"custom.css",
45+
]
4346
html_sidebars = {
4447
'**': ['localtoc.html']
4548
}

python/template.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,59 @@
11
.. raw:: html
22

33
<div>
4-
<table>
4+
<table id="packages">
55
{% for section in config %}
66
<tr>
7-
<td colspan=5 style="height:4em; vertical-align:center">
7+
<th colspan=5>
88
{% with section_id = section.name | lower | replace(" ", "-") %}
99
<h3 id="{{ section_id }}">
1010
{{ section.name }}
1111
<a class="headerlink" href="#{{ section_id }}" title="Permalink to this headline">¶</a>
1212
</h3>
1313
{% endwith %}
14-
</td>
14+
</th>
1515
</tr>
1616

1717
{% for package in section.packages %}
1818
<tr>
1919

20-
<td style="text-align:left; vertical-align:top;">
20+
<td>
2121
<a href="https://github.com/{{ package.user }}/{{ package.name }}">
22-
<img style="text-align:left; height:1.4em; max-width: none;" src="_static/badges/github-gray.svg">
22+
<img src="_static/badges/github-gray.svg">
2323
</a>
2424
</td>
2525

2626
{% if 'pypi' in package.badges %}
27-
<td style="text-align:left; vertical-align:top;">
27+
<td>
2828
<a href="https://pypi.python.org/pypi/{{ package.pypi_name }}">
29-
<img style="text-align:left; height:1.4em; max-width: none;" src="_static/badges/pip-orange.svg">
29+
<img src="_static/badges/pip-orange.svg">
3030
</a>
3131
</td>
3232
{% else %}
33-
<td style="text-align:center; style="vertical-align:top;">
34-
<img style="text-align:left; height:1.4em; max-width: none;" src="_static/badges/pip-empty.svg">
33+
<td>
34+
<img src="_static/badges/pip-empty.svg">
3535
</td>
3636
{% endif %}
3737
{% if 'conda' in package.badges %}
38-
<td style="text-align:left; vertical-align:top;">
38+
<td>
3939
<a href="https://anaconda.org/{{ package.conda_channel }}/{{ package.conda_package }}">
40-
<img style="text-align:left; height:1.4em; max-width: none;" src="_static/badges/conda-blue.svg">
40+
<img src="_static/badges/conda-blue.svg">
4141
</a>
4242
</td>
4343
{% else %}
44-
<td style="text-align:left;vertical-align:top; ">
45-
<img style="text-align:left; height:1.4em; max-width: none;" src="_static/badges/conda-empty.svg">
44+
<td>
45+
<img src="_static/badges/conda-empty.svg">
4646
</td>
4747
{% endif %}
4848

49-
<td style="vertical-align:top; text-align:left;cellpadding:0.3em">
49+
<td>
5050
{% if 'site' in package.badges %}
5151
<a href="{{ package.site_protocol}}://{{ package.site }}">{{ package.name }}</a>
5252
{% else %}
5353
<a href="http://github.com/{{ package.repo }}">{{ package.name }}</a>
5454
{% endif %}
5555
</td>
56-
<td style="text-align:left;vertical-align:top;cellpadding:0.3em">
56+
<td>
5757
{{ package.description }}
5858
</td>
5959

0 commit comments

Comments
 (0)