xhtml_report_generator 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8245325d398df596821aad2471b7fe703e541f1c
|
4
|
+
data.tar.gz: 8090a12abf591da6ee1f7af51483f142228dd029
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1195b1d581cfc0c25c47d077603e8f53a77e85d79e0ad28f5805a62464bd7427f040fafd6405fd112f390f69f6428b721c109e2dfdb9d9481796ddb1f8095ef
|
7
|
+
data.tar.gz: 39a0c261ac28951b05c1ed55bea11111f0cb00f66e0696cde7b800ee07ba1b9a0e6b1b55b3f9af1c27809d0c1b00e0569a44643edc826bb87ac18b24f5640316
|
@@ -15,6 +15,7 @@ module XhtmlReportGenerator
|
|
15
15
|
# :jquery if specified, path to a version of jquery, that will be inlined into the html header section
|
16
16
|
# :toc if specified, path to a javascript.js.rb file that contains the magic to generate all
|
17
17
|
# :css if specified, path to a css file that contains the markup rules for your generated reports
|
18
|
+
# :css_print if specified, path to a css file that contains the markup rules for printing the report
|
18
19
|
# :custom_rb if specified, path to a custom Module containing
|
19
20
|
def initialize(opts = {})
|
20
21
|
# define the default values
|
@@ -23,6 +24,7 @@ module XhtmlReportGenerator
|
|
23
24
|
:jquery => File.expand_path("jquery.js",path),
|
24
25
|
:toc => File.expand_path("toc.js",path),
|
25
26
|
:css => File.expand_path("style_template.css",path),
|
27
|
+
:css_print => File.expand_path("print_template.css",path),
|
26
28
|
:custom_rb => File.expand_path("custom.rb",path)
|
27
29
|
}
|
28
30
|
# either use the default files provided with the gem, or those provided by the caller
|
@@ -41,6 +43,9 @@ module XhtmlReportGenerator
|
|
41
43
|
style = head.add_element("style", {"type" => "text/css"})
|
42
44
|
# remove all newlines
|
43
45
|
style.add_text(REXML::CData.new("\n"+symbols[:css].gsub(/\n/, "")+"\n"))
|
46
|
+
|
47
|
+
style = head.add_element("style", {"type" => "text/css", "media"=>"print"})
|
48
|
+
style.add_text(REXML::CData.new("\n"+symbols[:css_print].gsub(/\n/, "")+"\n"))
|
44
49
|
|
45
50
|
script = head.add_element("script", {"type" => "text/javascript"})
|
46
51
|
script.add_text(REXML::CData.new("\n"+symbols[:jquery]+"\n"))
|
@@ -0,0 +1,35 @@
|
|
1
|
+
/* special css file for media=print, to hide and change some elements */
|
2
|
+
/* this is additive to the style_template.css */
|
3
|
+
|
4
|
+
/***********************
|
5
|
+
change positions to absolute to avoid printing the title and table
|
6
|
+
of contents on every page. Remove the Quicklink toc on the right.
|
7
|
+
Make toc on the left floating on top of middle div.
|
8
|
+
************************/
|
9
|
+
div.head {
|
10
|
+
position: absolute;
|
11
|
+
}
|
12
|
+
|
13
|
+
div.lefttoc {
|
14
|
+
position: relative;
|
15
|
+
width: 100%;
|
16
|
+
/*height:90%;*/
|
17
|
+
top: 100px;
|
18
|
+
left: 30px;
|
19
|
+
right: 30px;
|
20
|
+
bottom: auto;
|
21
|
+
border: none;
|
22
|
+
margin-bottom: 200px;
|
23
|
+
overflow: visible;
|
24
|
+
}
|
25
|
+
|
26
|
+
div.middle {
|
27
|
+
position: relative;
|
28
|
+
margin: 100px 30px 0 20px; /*top right bottom left */
|
29
|
+
/* margin: x y = Xpx each - botten and top, ypx each - left and right */
|
30
|
+
}
|
31
|
+
|
32
|
+
div.righttoc {
|
33
|
+
display: none;
|
34
|
+
}
|
35
|
+
|
@@ -2,7 +2,7 @@
|
|
2
2
|
body {
|
3
3
|
background: #FFFFFF;
|
4
4
|
font: 100% Arial, Helvetica, sans-serif;
|
5
|
-
color: #
|
5
|
+
color: #404040;
|
6
6
|
line-height: 110%;
|
7
7
|
margin: 0;
|
8
8
|
}
|
@@ -10,7 +10,7 @@ body {
|
|
10
10
|
p {
|
11
11
|
background: #FFFFFF;
|
12
12
|
font: 100% Arial, Helvetica, sans-serif;
|
13
|
-
color: #
|
13
|
+
color: #202020;
|
14
14
|
line-height: 110%;
|
15
15
|
text-align: left;
|
16
16
|
}
|
@@ -24,18 +24,18 @@ div.head {
|
|
24
24
|
width: 100%;
|
25
25
|
position: fixed;
|
26
26
|
top: 0px;
|
27
|
-
height:
|
27
|
+
height: 90px;
|
28
28
|
background: #FFFFFF;
|
29
29
|
z-index: 99;
|
30
30
|
}
|
31
31
|
|
32
32
|
div.lefttoc {
|
33
33
|
position: fixed;
|
34
|
-
width:
|
34
|
+
width: 20%;
|
35
35
|
/*height:90%;*/
|
36
36
|
top: 100px;
|
37
37
|
left: 5px;
|
38
|
-
bottom:
|
38
|
+
bottom: 20px;
|
39
39
|
border: solid 1px #000000;
|
40
40
|
overflow: auto;
|
41
41
|
white-space: nowrap;
|
@@ -44,7 +44,7 @@ div.lefttoc {
|
|
44
44
|
|
45
45
|
div.middle {
|
46
46
|
position: relative;
|
47
|
-
margin: 100px 160px 0
|
47
|
+
margin: 100px 160px 0 23%; /*top right bottom left */
|
48
48
|
/* margin: x y = Xpx each - botten and top, ypx each - left and right */
|
49
49
|
}
|
50
50
|
|
@@ -61,13 +61,33 @@ button {
|
|
61
61
|
width: 100%;
|
62
62
|
}
|
63
63
|
|
64
|
-
/*code*/
|
64
|
+
/*code light-blue*/
|
65
65
|
pre {
|
66
|
+
font-family: courier;
|
66
67
|
background: #E5F1F4;
|
67
68
|
font-size: 80%;
|
68
69
|
border: 1px dotted;
|
69
|
-
line-height:
|
70
|
+
line-height: 110%;
|
71
|
+
color: #000000;
|
72
|
+
white-space: pre-wrap;
|
73
|
+
word-wrap: break-word;
|
74
|
+
}
|
75
|
+
.code0 {
|
76
|
+
background: #E5F1F4;
|
77
|
+
}
|
78
|
+
/*code red-brown*/
|
79
|
+
.code1 {
|
80
|
+
background: #A66C75;
|
70
81
|
}
|
82
|
+
/*code light-green*/
|
83
|
+
.code2 {
|
84
|
+
background: #DAF1DD;
|
85
|
+
}
|
86
|
+
/*code light-yellow*/
|
87
|
+
.code3 {
|
88
|
+
background: #F5F2B7;
|
89
|
+
}
|
90
|
+
|
71
91
|
|
72
92
|
/*default highlight yellow*/
|
73
93
|
span {
|
@@ -113,8 +133,8 @@ h1:before {
|
|
113
133
|
font-size: 140%;
|
114
134
|
display: block;
|
115
135
|
content: " ";
|
116
|
-
margin-top: -
|
117
|
-
height:
|
136
|
+
margin-top: -100px;
|
137
|
+
height: 100px;
|
118
138
|
visibility: hidden;
|
119
139
|
}
|
120
140
|
|
@@ -1,2 +1,2 @@
|
|
1
1
|
// "THE BEER-WARE LICENSE" (Revision 42): m-widmer@gmx wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return Manuel Widmer
|
2
|
-
$(document).ready(function(){$("[class=rtoconly],[class=bothtoc]").each(function(b){var a=$(this);type=a.attr("class");a.attr("id",type+b);$("#rtoc").append("<a href='#"+type+b+"'>"+a.html()+"</a> <br />\n")});h3index=h2index=h1index=0;$("h1, h2, h3, a.h2, a.h1").each(function(b){var a=$(this);void 0==a.attr("id")&&a.attr("id","title"+b);if("h1"==a.prop("tagName"))h1index+=1,h3index=h2index=0,a.prepend(h1index+" "),$("#ltoc").append("<br />\n"),lasth1="#"+a.attr("id"),lasth1cont=a.html();else if("h2"==
|
2
|
+
$(document).ready(function(){$("td").each(function(b){b=$(this);null!==b.html().match(/passed/)&&b.attr("style","background-color:#00FF00;");null!==b.html().match(/failed/)&&b.attr("style","background-color:#FF0000;")});$("[class=rtoconly],[class=bothtoc]").each(function(b){var a=$(this);type=a.attr("class");a.attr("id",type+b);$("#rtoc").append("<a href='#"+type+b+"'>"+a.html()+"</a> <br />\n")});h3index=h2index=h1index=0;$("h1, h2, h3, a.h2, a.h1").each(function(b){var a=$(this);void 0==a.attr("id")&& a.attr("id","title"+b);if("h1"==a.prop("tagName"))h1index+=1,h3index=h2index=0,a.prepend(h1index+" "),$("#ltoc").append("<br />\n"),lasth1="#"+a.attr("id"),lasth1cont=a.html();else if("h2"==a.prop("tagName"))h2index+=1,h3index=0,a.prepend(h1index+"."+h2index+" "),lasth2="#"+a.attr("id"),lasth2cont=a.html();else if("h3"==a.prop("tagName"))h3index+=1,a.prepend(h1index+"."+h2index+"."+h3index+" ");else{if("h1"==a.attr("class"))return a.attr("href",lasth1),a.html(lasth1cont),0;if("h2"==a.attr("class"))return a.attr("href", lasth2),a.html(lasth2cont),0}if("rtoconly"==a.attr("class"))return 0;$("#ltoc").append("<a id='link"+b+"' href='#"+a.attr("id")+"' >"+a.html()+"</a> <br />\n");return 0})});
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xhtml_report_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manuel Widmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: "The generator can be used to create xhtml files. It comes with some
|
14
14
|
default utility functions.\n== Here is an example usage\n gen1 = XhtmlReportGenerator::Generator.new\n
|
@@ -29,6 +29,7 @@ files:
|
|
29
29
|
- lib/xhtml_report_generator.rb
|
30
30
|
- lib/xhtml_report_generator/custom.rb
|
31
31
|
- lib/xhtml_report_generator/jquery.js
|
32
|
+
- lib/xhtml_report_generator/print_template.css
|
32
33
|
- lib/xhtml_report_generator/style_template.css
|
33
34
|
- lib/xhtml_report_generator/toc.js
|
34
35
|
- lib/xhtml_report_generator/version.rb
|