From cc94a7dd39c02c4dfb40449cda66063ba9ec72f4 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 3 Feb 2016 06:50:09 -0500 Subject: A way to show much longer explanations about lines in the HTML report. --- coverage/htmlfiles/pyfile.html | 2 +- coverage/htmlfiles/style.css | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'coverage/htmlfiles') diff --git a/coverage/htmlfiles/pyfile.html b/coverage/htmlfiles/pyfile.html index ad7969d..fb8e131 100644 --- a/coverage/htmlfiles/pyfile.html +++ b/coverage/htmlfiles/pyfile.html @@ -77,7 +77,7 @@ {% for line in lines %} -

{% if line.annotate %}{{line.annotate}}{% endif %}{{line.html}} 

+

{% if line.annotate %}{{line.annotate}}{{line.annotate_long}}{% endif %}{{line.html}} 

{% endfor %} diff --git a/coverage/htmlfiles/style.css b/coverage/htmlfiles/style.css index 4f43b59..ea261e9 100644 --- a/coverage/htmlfiles/style.css +++ b/coverage/htmlfiles/style.css @@ -160,7 +160,7 @@ h2.stats { .help_panel { position: absolute; - background: #ffc; + background: #ffffcc; padding: .5em; border: 1px solid #883; display: none; @@ -227,6 +227,7 @@ td.text { padding: 0 0 0 .5em; border-left: 2px solid #ffffff; white-space: pre; + position: relative; } .text p.mis { @@ -259,6 +260,25 @@ td.text { .text p.hide_par span.annotate { display: none; } +.text span.annotate.long { + display: none; + } +.text p:hover span.annotate.long { + display: block; + max-width: 50%; + white-space: normal; + float: right; + position: absolute; + top: 1.5em; + right: 0; + width: 30em; + height: auto; + background: #ffffcc; + border: 1px solid #888; + padding: .25em .5em; + z-index: 999; + + } /* Syntax coloring */ .text .com { -- cgit v1.2.1