Skip to content

Commit 82a5c98

Browse files
committed
feat(html): version and timestamp at the top of report files.
This is a re-implementation of pull #1354.
1 parent af029c8 commit 82a5c98

File tree

4 files changed

+39
-24
lines changed

4 files changed

+39
-24
lines changed

coverage/htmlfiles/pyfile.html

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ <h2>
7777
{% endif %}
7878
</h2>
7979

80+
<p>
81+
<a id="prevFileLink" class="nav" href="{{ prev_html }}">&#xab; prev</a> &nbsp; &nbsp;
82+
<a id="indexLink" class="nav" href="index.html">&Hat; index</a> &nbsp; &nbsp;
83+
<a id="nextFileLink" class="nav" href="{{ next_html }}">&#xbb; next</a>
84+
&nbsp; &nbsp; &nbsp;
85+
<a class="nav" href="{{__url__}}">coverage.py v{{__version__}}</a>,
86+
created at {{ time_stamp }}
87+
</p>
88+
8089
<div style="display: none;">
8190
<button type="button" class="button_next_chunk" data-shortcut="j">Next highlighted chunk</button>
8291
<button type="button" class="button_prev_chunk" data-shortcut="k">Previous highlighted chunk</button>
@@ -125,11 +134,10 @@ <h2>
125134
<footer>
126135
<div class="content">
127136
<p>
128-
<a id="prevFileLink" class="nav" href="{{ prev_html }}">&#xab; prev file</a> &nbsp; &nbsp;
137+
<a id="prevFileLink" class="nav" href="{{ prev_html }}">&#xab; prev</a> &nbsp; &nbsp;
129138
<a id="indexLink" class="nav" href="index.html">&Hat; index</a> &nbsp; &nbsp;
130-
<a id="nextFileLink" class="nav" href="{{ next_html }}">&#xbb; next file</a>
131-
</p>
132-
<p>
139+
<a id="nextFileLink" class="nav" href="{{ next_html }}">&#xbb; next</a>
140+
&nbsp; &nbsp; &nbsp;
133141
<a class="nav" href="{{__url__}}">coverage.py v{{__version__}}</a>,
134142
created at {{ time_stamp }}
135143
</p>

coverage/htmlfiles/style.css

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,13 @@ header .content { padding: 1rem 3.5rem; }
3838

3939
header h2 { margin-top: .5em; font-size: 1em; }
4040

41+
header p { margin: .5em 0 -.5em; color: #666; font-style: italic; }
42+
43+
@media (prefers-color-scheme: dark) { header p { color: #aaa; } }
44+
4145
header.sticky { position: fixed; left: 0; right: 0; height: 2.5em; }
4246

43-
header.sticky .text { display: none; }
47+
header.sticky p, header.sticky .text { display: none; }
4448

4549
header.sticky h1, header.sticky h2 { font-size: 1em; margin-top: 0; display: inline-block; }
4650

@@ -52,9 +56,7 @@ header.sticky ~ #source { padding-top: 6.5em; }
5256

5357
main { position: relative; z-index: 1; }
5458

55-
.indexfile footer { margin: 1rem 3.5rem; }
56-
57-
.pyfile footer { margin: 1rem 1rem; }
59+
footer { margin: 1rem 3.5rem; }
5860

5961
footer .content { padding: 0; color: #666; font-style: italic; }
6062

coverage/htmlfiles/style.scss

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,20 @@ header {
174174
font-size: 1em;
175175
}
176176

177+
p {
178+
margin: .5em 0 -.5em;
179+
color: $light-gray5;
180+
@include color-dark($dark-gray5);
181+
font-style: italic;
182+
}
183+
177184
&.sticky {
178185
position: fixed;
179186
left: 0;
180187
right: 0;
181188
height: 2.5em;
182189

183-
.text {
190+
p, .text {
184191
display: none;
185192
}
186193

@@ -208,19 +215,15 @@ main {
208215
z-index: 1;
209216
}
210217

211-
.indexfile footer {
218+
footer {
212219
margin: 1rem $left-gutter;
213-
}
214220

215-
.pyfile footer {
216-
margin: 1rem 1rem;
217-
}
218-
219-
footer .content {
220-
padding: 0;
221-
color: $light-gray5;
222-
@include color-dark($dark-gray5);
223-
font-style: italic;
221+
.content {
222+
padding: 0;
223+
color: $light-gray5;
224+
@include color-dark($dark-gray5);
225+
font-style: italic;
226+
}
224227
}
225228

226229
#index {

tests/gold/html/styled/style.css

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,13 @@ header .content { padding: 1rem 3.5rem; }
3838

3939
header h2 { margin-top: .5em; font-size: 1em; }
4040

41+
header p { margin: .5em 0 -.5em; color: #666; font-style: italic; }
42+
43+
@media (prefers-color-scheme: dark) { header p { color: #aaa; } }
44+
4145
header.sticky { position: fixed; left: 0; right: 0; height: 2.5em; }
4246

43-
header.sticky .text { display: none; }
47+
header.sticky p, header.sticky .text { display: none; }
4448

4549
header.sticky h1, header.sticky h2 { font-size: 1em; margin-top: 0; display: inline-block; }
4650

@@ -52,9 +56,7 @@ header.sticky ~ #source { padding-top: 6.5em; }
5256

5357
main { position: relative; z-index: 1; }
5458

55-
.indexfile footer { margin: 1rem 3.5rem; }
56-
57-
.pyfile footer { margin: 1rem 1rem; }
59+
footer { margin: 1rem 3.5rem; }
5860

5961
footer .content { padding: 0; color: #666; font-style: italic; }
6062

0 commit comments

Comments
 (0)