Skip to content

Switch coverage.nodejs.org to an HTML table #1938

@nschonni

Description

@nschonni

The currently styling can probably be maintained, but this is better for accessibility and semantics.

<div class="table">
<div class="table-header">
<div>Date (UTC)</div>
<div>HEAD</div>
<div>JS Coverage</div>
<div>C++ Coverage</div>
</div>
''')
for line in reversed(index_csv):
jscov, cxxcov, date, sha = line.split(',')
date = datetime.datetime.strptime(date, '%Y-%m-%dT%H:%M:%S%fZ').strftime("%d/%m/%Y %H:%M")
out.write('''
<div class="table-row">
<div><div class="cell-header">Date (UTC)</div><div class="cell-value">{0}</div></div>
<div class="sha"><div class="cell-header">HEAD</div><div class="cell-value"><a href="https://github.com/nodejs/node/commit/{1}">{1}</a></div></div>
<div><div class="cell-header">JS Coverage</div><div class="cell-value"><a href="coverage-{1}/index.html">{2:05.2f}&nbsp;%</a></div></div>
<div><div class="cell-header">C++ Coverage</div><div class="cell-value"><a href="coverage-{1}/cxxcoverage.html">{3:05.2f}&nbsp;%</a></div></div>
</div>'''.format(date, sha, float(jscov), float(cxxcov)))
out.write('''
</div>
</div>

If the preference is to keep the divs, then adding aria would be the alternate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions