origen_doc_helpers 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/environment.rb +2 -0
- data/config/version.rb +2 -2
- data/lib/helpers.rb +13 -6
- data/lib/origen_doc_helpers/html_flow_formatter.rb +209 -0
- data/lib/origen_doc_helpers/list_flow_formatter.rb +92 -0
- data/templates/shared/test/_flow.md.erb +188 -0
- metadata +6 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee3e3f947570dd8db7cd7eeca0321269b048e832
|
4
|
+
data.tar.gz: 3674401952587d0d7a14421b205935b6dcafc44b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2999b9c681e79d2625cb9c4f2c1eccda196573d7a68357d29adad24a25a34cd4d577541d26bef76932ab6d9b4e4ee46f38112973f480cc745b1690e88acd92ee
|
7
|
+
data.tar.gz: bb1b457ffa445709a35f91a05f8d0181c4cab356cbde177dfb803193ec2e5c8dac87ef8b51281be56fbdb4a4dccd11207ca65434e20085f1977f8f12a8f4de74
|
data/config/environment.rb
CHANGED
@@ -26,5 +26,7 @@
|
|
26
26
|
#require "#{Origen.root}/c90_top_level/p2"
|
27
27
|
module OrigenDocHelpers
|
28
28
|
autoload :PDF, "origen_doc_helpers/pdf"
|
29
|
+
autoload :HtmlFlowFormatter, "origen_doc_helpers/html_flow_formatter"
|
30
|
+
autoload :ListFlowFormatter, "origen_doc_helpers/list_flow_formatter"
|
29
31
|
end
|
30
32
|
require "helpers"
|
data/config/version.rb
CHANGED
data/lib/helpers.rb
CHANGED
@@ -178,29 +178,36 @@ END
|
|
178
178
|
flow[:soft_bin] || flow[:softbin]
|
179
179
|
end
|
180
180
|
|
181
|
-
def _start_accordion(heading,
|
181
|
+
def _start_accordion(heading, options = {})
|
182
|
+
options = {
|
183
|
+
panel: :default
|
184
|
+
}.merge(options)
|
182
185
|
@_accordion_index ||= 0
|
183
186
|
@_accordion_index += 1
|
184
187
|
<<-END
|
185
|
-
|
186
|
-
|
187
|
-
<div class="panel
|
188
|
-
<a class="
|
188
|
+
|
189
|
+
|
190
|
+
<div class="panel panel-#{options[:panel]}">
|
191
|
+
<a href="#_" class="expand-collapse-switch btn btn-xs pull-right btn-default" state="0"><i class='fa fa-plus'></i></a>
|
192
|
+
<div class="panel-heading clickable" data-toggle="collapse" data-parent="#blah2" href="#collapseAccordion#{@_accordion_index}">
|
189
193
|
#{heading}
|
190
|
-
</a>
|
191
194
|
</div>
|
192
195
|
<div id="collapseAccordion#{@_accordion_index}" class="panel-collapse collapse">
|
193
196
|
<div class="panel-body" markdown="1">
|
194
197
|
|
198
|
+
|
195
199
|
END
|
196
200
|
end
|
197
201
|
|
198
202
|
def _stop_accordion
|
199
203
|
<<-END
|
200
204
|
|
205
|
+
|
201
206
|
</div>
|
202
207
|
</div>
|
203
208
|
</div>
|
209
|
+
|
210
|
+
|
204
211
|
END
|
205
212
|
end
|
206
213
|
|
@@ -0,0 +1,209 @@
|
|
1
|
+
require 'atp'
|
2
|
+
require 'kramdown'
|
3
|
+
module OrigenDocHelpers
|
4
|
+
class HtmlFlowFormatter < ATP::Formatter
|
5
|
+
include Origen::Generator::Compiler::DocHelpers::TestFlowHelpers
|
6
|
+
|
7
|
+
attr_reader :html
|
8
|
+
|
9
|
+
def format(node, options = {})
|
10
|
+
@html = ''
|
11
|
+
process(node)
|
12
|
+
html
|
13
|
+
end
|
14
|
+
|
15
|
+
def on_flow(node)
|
16
|
+
@flow ||= 0
|
17
|
+
@flow += 1
|
18
|
+
html << "<div class=\"panel-group\" id=\"test_flow_#{@flow}\">"
|
19
|
+
html << _start_accordion(node.to_a[0].value)
|
20
|
+
if node.description && !node.description.empty?
|
21
|
+
html << to_html(node.description.join("\n"))
|
22
|
+
html << '<hr>'
|
23
|
+
end
|
24
|
+
process_all(node)
|
25
|
+
html << _stop_accordion
|
26
|
+
html << '</div>'
|
27
|
+
end
|
28
|
+
|
29
|
+
def on_group(node)
|
30
|
+
html << "<div class=\"row test-overview\">"
|
31
|
+
html << " <div class=\"header\">"
|
32
|
+
html << " <span class=\"pull-right\"><a class=\"top-link\" href=\"#\">back to top</a></span>"
|
33
|
+
html << " <h4 class=\"no-anchor\">#{node.to_a[0].value}</h4>"
|
34
|
+
html << ' </div>'
|
35
|
+
|
36
|
+
html << "<div class=\"col-md-12\" style=\"margin-bottom: 15px;\">"
|
37
|
+
html << " <div class=\"col-md-4\">"
|
38
|
+
@within_test = true
|
39
|
+
@object = ''
|
40
|
+
on_fail = node.find(:on_fail)
|
41
|
+
on_pass = node.find(:on_pass)
|
42
|
+
process(on_fail) if on_fail
|
43
|
+
process(on_pass) if on_pass
|
44
|
+
html << @object
|
45
|
+
@within_test = false
|
46
|
+
html << ' </div>'
|
47
|
+
html << " <div class=\"col-md-8 description-pane\">"
|
48
|
+
html << to_html(node.description.join("\n")) if node.description
|
49
|
+
html << ' </div>'
|
50
|
+
html << ' </div>'
|
51
|
+
|
52
|
+
@group ||= 0
|
53
|
+
@group += 1
|
54
|
+
html << "<div class=\"col-md-12 panel-group\" id=\"test_group_#{@group}\">"
|
55
|
+
html << _start_accordion('Tests')
|
56
|
+
process_all(node.children - [on_fail, on_pass])
|
57
|
+
html << _stop_accordion
|
58
|
+
html << '</div>'
|
59
|
+
|
60
|
+
html << '</div>'
|
61
|
+
end
|
62
|
+
|
63
|
+
def on_flow_flag(node)
|
64
|
+
@flow_flag ||= 0
|
65
|
+
@flow_flag += 1
|
66
|
+
flags = [node.to_a[0]].flatten
|
67
|
+
flags = flags.map do |flag|
|
68
|
+
"<span class=\"label label-info\">#{flag}</span>"
|
69
|
+
end
|
70
|
+
if node.to_a[1]
|
71
|
+
text = "<span class=\"connector\">IF</span>" + flags.join("<span class=\"connector\">OR</span>")
|
72
|
+
else
|
73
|
+
text = "<span class=\"connector\">UNLESS</span>" + flags.join("<span class=\"connector\">OR</span>")
|
74
|
+
end
|
75
|
+
html << "<div class=\"row test-overview\">"
|
76
|
+
html << "<div class=\"panel-group col-md-12\" id=\"flow_flag_#{@flow_flag}\">"
|
77
|
+
html << _start_accordion(text, panel: :warning)
|
78
|
+
process_all(node)
|
79
|
+
html << _stop_accordion
|
80
|
+
html << '</div>'
|
81
|
+
html << '</div>'
|
82
|
+
end
|
83
|
+
|
84
|
+
def on_run_flag(node)
|
85
|
+
@run_flag ||= 0
|
86
|
+
@run_flag += 1
|
87
|
+
flags = [node.to_a[0]].flatten
|
88
|
+
flags = flags.map do |flag|
|
89
|
+
if flag =~ /FAILED/
|
90
|
+
"<span class=\"label label-danger\">#{flag}</span>"
|
91
|
+
elsif flag =~ /PASSED/
|
92
|
+
"<span class=\"label label-success\">#{flag}</span>"
|
93
|
+
else
|
94
|
+
"<span class=\"label label-info\">#{flag}</span>"
|
95
|
+
end
|
96
|
+
end
|
97
|
+
text = "<span class=\"connector\">IF</span>" + flags.join("<span class=\"connector\">OR</span>")
|
98
|
+
html << "<div class=\"row test-overview\">"
|
99
|
+
html << "<div class=\"panel-group col-md-12\" id=\"run_flag_#{@run_flag}\">"
|
100
|
+
html << _start_accordion(text, panel: :info)
|
101
|
+
process_all(node)
|
102
|
+
html << _stop_accordion
|
103
|
+
html << '</div>'
|
104
|
+
html << '</div>'
|
105
|
+
end
|
106
|
+
|
107
|
+
def on_set_result(node)
|
108
|
+
unless @within_continue
|
109
|
+
type, *nodes = *node
|
110
|
+
bin = node.find(:bin).try(:value)
|
111
|
+
sbin = node.find(:softbin).try(:value)
|
112
|
+
unless @within_test
|
113
|
+
html << "<div class=\"row\">"
|
114
|
+
html << " <div class=\"col-md-4\">"
|
115
|
+
if type == 'fail'
|
116
|
+
html << " <h4 class=\"no-anchor\">Set Result - FAIL</h4>"
|
117
|
+
else
|
118
|
+
html << " <h4 class=\"no-anchor\">Set Result - PASS</h4>"
|
119
|
+
end
|
120
|
+
end
|
121
|
+
if type == 'fail'
|
122
|
+
html << "<span class=\"label label-danger\">Bin #{bin}</span>" if bin
|
123
|
+
html << "<span class=\"label label-danger\">Softbin #{sbin}</span>" if sbin
|
124
|
+
else
|
125
|
+
html << "<span class=\"label label-success\">Bin #{bin}</span>" if bin
|
126
|
+
html << "<span class=\"label label-success\">Softbin #{sbin}</span>" if sbin
|
127
|
+
end
|
128
|
+
unless @within_test
|
129
|
+
html << ' </div>'
|
130
|
+
html << " <div class=\"col-md-8 description-pane\">"
|
131
|
+
html << ' </div>'
|
132
|
+
html << '</div>'
|
133
|
+
html << '<hr>'
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
def on_set_run_flag(node)
|
139
|
+
if @within_on_fail
|
140
|
+
html << "<span class=\"label label-danger\">#{node.value}</span>"
|
141
|
+
else
|
142
|
+
html << "<span class=\"label label-success\">#{node.value}</span>"
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
def on_on_fail(node)
|
147
|
+
@within_continue = !!node.find(:continue)
|
148
|
+
@within_on_fail = true
|
149
|
+
process_all(node.children)
|
150
|
+
@within_continue = false
|
151
|
+
@within_on_fail = false
|
152
|
+
end
|
153
|
+
|
154
|
+
def on_continue(node)
|
155
|
+
if @within_on_fail
|
156
|
+
html << "<span class=\"label label-danger\">Continue</span>"
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
def on_test(node)
|
161
|
+
id = node.find(:id).value
|
162
|
+
html << "<div class=\"row test-overview\" id=\"flow_#{@flow}_test_#{id}\">"
|
163
|
+
html << " <a class=\"anchor\" name=\"flow_#{@flow}_test_#{id}\"></a>"
|
164
|
+
html << " <div class=\"header\">"
|
165
|
+
if n = node.find(:name)
|
166
|
+
name = n.value
|
167
|
+
else
|
168
|
+
name = node.find(:object).value['Test']
|
169
|
+
end
|
170
|
+
number = node.find(:number).try(:value)
|
171
|
+
html << " <span class=\"pull-right\"><a class=\"list-link\" href=\"#\" data-testid=\"list_#{@flow}_test_#{id}\">view in datalog</a><span> | </span><a class=\"top-link\" href=\"#\">back to top</a></span>"
|
172
|
+
html << " <h4 class=\"no-anchor\">#{name}<span class=\"test-number\">#{number ? ' - ' + number.to_s : ''}</span></h4>"
|
173
|
+
html << ' </div>'
|
174
|
+
html << " <div class=\"col-md-4\">"
|
175
|
+
@within_test = true
|
176
|
+
@object = ''
|
177
|
+
process_all(node.children)
|
178
|
+
html << @object
|
179
|
+
@within_test = false
|
180
|
+
html << ' </div>'
|
181
|
+
html << " <div class=\"col-md-8 description-pane\">"
|
182
|
+
html << to_html(node.description.join("\n")) if node.description
|
183
|
+
html << ' </div>'
|
184
|
+
html << '</div>'
|
185
|
+
end
|
186
|
+
|
187
|
+
def on_object(node)
|
188
|
+
t = node.to_a.first
|
189
|
+
@object << "<hr><div class=\"test-attributes\">"
|
190
|
+
if t.is_a?(String)
|
191
|
+
@object << "<strong>Test: </strong><span>#{t}</span>"
|
192
|
+
elsif t.is_a?(Hash)
|
193
|
+
t.each do |key, value|
|
194
|
+
@object << "<strong>#{key}: </strong><span>#{value}</span><br>"
|
195
|
+
end
|
196
|
+
end
|
197
|
+
@object << '</div>'
|
198
|
+
end
|
199
|
+
|
200
|
+
# Convert the given markdown string to HTML
|
201
|
+
def to_html(string, _options = {})
|
202
|
+
# Escape any " that are not already escaped
|
203
|
+
string.gsub!(/([^\\])"/, '\1\"')
|
204
|
+
# Escape any ' that are not already escaped
|
205
|
+
string.gsub!(/([^\\])'/, %q(\1\\\'))
|
206
|
+
html = Kramdown::Document.new(string, input: :kramdown).to_html
|
207
|
+
end
|
208
|
+
end
|
209
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
require 'atp'
|
2
|
+
module OrigenDocHelpers
|
3
|
+
class ListFlowFormatter < ATP::Formatter
|
4
|
+
attr_reader :html
|
5
|
+
|
6
|
+
def format(node, options = {})
|
7
|
+
@html = ''
|
8
|
+
process(node)
|
9
|
+
html
|
10
|
+
end
|
11
|
+
|
12
|
+
def open_table
|
13
|
+
str = ''
|
14
|
+
# str << "<table class=\"table table-striped\">"
|
15
|
+
str << "<table class=\"table table-hover\">"
|
16
|
+
str << '<thead><tr>'
|
17
|
+
str << '<th>Number</th>'
|
18
|
+
str << '<th>Result</th>'
|
19
|
+
str << '<th>Name</th>'
|
20
|
+
str << '<th>Test</th>'
|
21
|
+
str << '<th>Bin</th>'
|
22
|
+
str << '<th>Softbin</th>'
|
23
|
+
str << '</tr></thead>'
|
24
|
+
str
|
25
|
+
end
|
26
|
+
|
27
|
+
def close_table
|
28
|
+
'</table>'
|
29
|
+
end
|
30
|
+
|
31
|
+
def on_flow(node)
|
32
|
+
@flow ||= 0
|
33
|
+
@flow += 1
|
34
|
+
process_all(node)
|
35
|
+
end
|
36
|
+
|
37
|
+
def on_log(node)
|
38
|
+
html << "<tr><td colspan=\"6\"><strong>LOG: </strong> #{node.value}</td></tr>"
|
39
|
+
end
|
40
|
+
|
41
|
+
def on_render(node)
|
42
|
+
html << "<tr><td colspan=\"6\"><strong>RENDER: </strong> An expicitly rendered flow snippet occurs here</td></tr>"
|
43
|
+
end
|
44
|
+
|
45
|
+
def on_test(node)
|
46
|
+
id = node.find(:id).value
|
47
|
+
html << "<tr id=\"list_#{@flow}_test_#{id}\" class=\"list-test-line clickable\" data-testid=\"flow_#{@flow}_test_#{id}\">"
|
48
|
+
html << "<td>#{node.find(:number).try(:value)}</td>"
|
49
|
+
if node.find(:failed)
|
50
|
+
html << '<td>FAIL</td>'
|
51
|
+
else
|
52
|
+
html << '<td>PASS</td>'
|
53
|
+
end
|
54
|
+
if n = node.find(:name)
|
55
|
+
name = n.value
|
56
|
+
else
|
57
|
+
name = node.find(:object).value['Test']
|
58
|
+
end
|
59
|
+
html << "<td>#{name}</td>"
|
60
|
+
html << "<td>#{node.find(:object).value['Test']}</td>"
|
61
|
+
|
62
|
+
if (f1 = node.find(:on_fail)) && (r1 = f1.find(:set_result)) && (b1 = r1.find(:bin))
|
63
|
+
html << "<td>B#{b1.value}</td>"
|
64
|
+
else
|
65
|
+
html << '<td></td>'
|
66
|
+
end
|
67
|
+
|
68
|
+
if (f2 = node.find(:on_fail)) && (r2 = f2.find(:set_result)) && (b2 = r2.find(:softbin))
|
69
|
+
html << "<td>S#{b2.value}</td>"
|
70
|
+
else
|
71
|
+
html << '<td></td>'
|
72
|
+
end
|
73
|
+
|
74
|
+
html << '</tr>'
|
75
|
+
end
|
76
|
+
|
77
|
+
def on_set_result(node)
|
78
|
+
html << '<tr>'
|
79
|
+
html << '<td></td>'
|
80
|
+
if node.to_a[0] == 'pass'
|
81
|
+
html << '<td>PASS</td>'
|
82
|
+
else
|
83
|
+
html << '<td>FAIL</td>'
|
84
|
+
end
|
85
|
+
html << '<td></td>'
|
86
|
+
html << '<td></td>'
|
87
|
+
html << "<td>#{node.find(:bin).try(:value)}</td>"
|
88
|
+
html << "<td>#{node.find(:softbin).try(:value)}</td>"
|
89
|
+
html << '</tr>'
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -4,6 +4,192 @@
|
|
4
4
|
% flows = options[:flow] || options[:flows]
|
5
5
|
% flows = flows ? [flows].flatten : nil
|
6
6
|
|
7
|
+
% if !program
|
8
|
+
% Origen.target.temporary = options[:target]
|
9
|
+
% program = OrigenTesters.program
|
10
|
+
|
11
|
+
<style>
|
12
|
+
.clickable { cursor: pointer }
|
13
|
+
h5 strong { font-size: 12px }
|
14
|
+
.description-pane { border-left: 1px solid #eee }
|
15
|
+
span.label, span.connector { margin-right: 5px; }
|
16
|
+
.test-overview { border-bottom: 2px solid #aaa; margin-bottom: 10px; padding-bottom: 10px; }
|
17
|
+
.test-attributes { font-size: 12px }
|
18
|
+
.test-overview .header { padding: 0 15px 5px 15px; }
|
19
|
+
.test-overview .panel-group { margin-bottom: 0; }
|
20
|
+
h4 .test-number { font-size: 14px; }
|
21
|
+
table tr th { text-align: left !important; }
|
22
|
+
</style>
|
23
|
+
|
24
|
+
<script type="text/javascript">
|
25
|
+
// Modified from: http://jsfiddle.net/jhfrench/mc4Qd/
|
26
|
+
window.onload = function() {
|
27
|
+
$('.expand-collapse-switch').click(function() {
|
28
|
+
|
29
|
+
var newstate = $(this).attr('state') ^ 1,
|
30
|
+
icon = newstate ? "minus" : "plus";
|
31
|
+
|
32
|
+
// if state=0, show all the accordion divs within the same block (in this case, within the same section)
|
33
|
+
if ( $(this).attr('state')==="0" ) {
|
34
|
+
$(this).parent().find('div.panel-collapse:not(.in)').collapse('show');
|
35
|
+
$(this).parent().find('.expand-collapse-switch').html("<i class=\"fa fa-" + icon + "\"></i>").attr('state', newstate);
|
36
|
+
}
|
37
|
+
// otherwise, collapse all the divs
|
38
|
+
else {
|
39
|
+
$(this).parent().find('div.panel-collapse.in').collapse('hide');
|
40
|
+
$(this).parent().find('.expand-collapse-switch').html("<i class=\"fa fa-" + icon + "\"></i>").attr('state', newstate);
|
41
|
+
}
|
42
|
+
|
43
|
+
$(this).html("<i class=\"fa fa-" + icon + "\"></i>");
|
44
|
+
|
45
|
+
$(this).attr('state',newstate)
|
46
|
+
|
47
|
+
return false;
|
48
|
+
});
|
49
|
+
|
50
|
+
$('.expand-all-link').click(function() {
|
51
|
+
$('div.panel-collapse:not(.in)').collapse('show');
|
52
|
+
$('.expand-collapse-switch').html("<i class=\"fa fa-minus\"></i>").attr('state', 1);
|
53
|
+
return false;
|
54
|
+
});
|
55
|
+
|
56
|
+
$('.collapse-all-link').click(function() {
|
57
|
+
$('div.panel-collapse.in').collapse('hide');
|
58
|
+
$('.expand-collapse-switch').html("<i class=\"fa fa-plus\"></i>").attr('state', 0);
|
59
|
+
return false;
|
60
|
+
});
|
61
|
+
|
62
|
+
var tab = getUrlParameter("tab")
|
63
|
+
if (tab == "flow") {
|
64
|
+
$("#flow-tab-select").tab("show");
|
65
|
+
}
|
66
|
+
|
67
|
+
// When a test line in the flow listing is clicked, show the test in the flow view
|
68
|
+
$('.list-test-line').click(function() {
|
69
|
+
var id = "#" + $(this).data("testid");
|
70
|
+
// Show the flow tab
|
71
|
+
$("#flow-tab-select").tab("show");
|
72
|
+
// Expand the elements wrapping the target test
|
73
|
+
$(id).parents('div.panel-collapse:not(.in)').collapse('show');
|
74
|
+
$(id).parents('.panel').children('.expand-collapse-switch').html("<i class=\"fa fa-minus\"></i>").attr('state', 1);
|
75
|
+
// Then scroll to it
|
76
|
+
jQuery('html,body').animate({scrollTop: jQuery(id).offset().top - 300}, 1000);
|
77
|
+
flashIt($(id), 10);
|
78
|
+
return false;
|
79
|
+
});
|
80
|
+
|
81
|
+
// Links to listing from the flow view of tests
|
82
|
+
$('.list-link').click(function() {
|
83
|
+
var id = "#" + $(this).data("testid");
|
84
|
+
// Show the flow tab
|
85
|
+
$("#list-tab-select").tab("show");
|
86
|
+
// Then scroll to it
|
87
|
+
jQuery('html,body').animate({scrollTop: jQuery(id).offset().top - 350}, 500);
|
88
|
+
flashIt($(id), 10);
|
89
|
+
return false;
|
90
|
+
});
|
91
|
+
|
92
|
+
// Remove any links where the given test is not present
|
93
|
+
$(".list-link").each(function() {
|
94
|
+
var id = "#" + $(this).data("testid");
|
95
|
+
if ($(id).length == 0) {
|
96
|
+
$(this).next().remove() // Remove the separator
|
97
|
+
$(this).remove();
|
98
|
+
}
|
99
|
+
});
|
100
|
+
|
101
|
+
// Links to the top of the page
|
102
|
+
$('.top-link').click(function() {
|
103
|
+
jQuery('html,body').animate({scrollTop: 0}, 500);
|
104
|
+
return false;
|
105
|
+
});
|
106
|
+
|
107
|
+
// Update the +/- icons when a panel is changed manually by clicking it
|
108
|
+
$('.panel-collapse').on('hidden.bs.collapse', function () {
|
109
|
+
if ($(this).hasClass("in") == false) {
|
110
|
+
$(this).parent().children('.expand-collapse-switch').html("<i class=\"fa fa-plus\"></i>").attr('state', 0);
|
111
|
+
}
|
112
|
+
})
|
113
|
+
|
114
|
+
$('.panel-collapse').on('shown.bs.collapse', function () {
|
115
|
+
if ($(this).hasClass("in") == true) {
|
116
|
+
$(this).parent().children('.expand-collapse-switch').html("<i class=\"fa fa-minus\"></i>").attr('state', 1);
|
117
|
+
}
|
118
|
+
})
|
119
|
+
};
|
120
|
+
|
121
|
+
var getUrlParameter = function getUrlParameter(sParam) {
|
122
|
+
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
|
123
|
+
sURLVariables = sPageURL.split('&'),
|
124
|
+
sParameterName,
|
125
|
+
i;
|
126
|
+
|
127
|
+
for (i = 0; i < sURLVariables.length; i++) {
|
128
|
+
sParameterName = sURLVariables[i].split('=');
|
129
|
+
|
130
|
+
if (sParameterName[0] === sParam) {
|
131
|
+
return sParameterName[1] === undefined ? true : sParameterName[1];
|
132
|
+
}
|
133
|
+
}
|
134
|
+
};
|
135
|
+
|
136
|
+
function flashIt(element, times){
|
137
|
+
for (var i=0; i < times; i++){
|
138
|
+
setTimeout(function(){
|
139
|
+
$(element).toggleClass("highlight");
|
140
|
+
}, (300 * i));
|
141
|
+
};
|
142
|
+
};
|
143
|
+
</script>
|
144
|
+
|
145
|
+
|
146
|
+
<div class="row">
|
147
|
+
<div class="col-md-12">
|
148
|
+
|
149
|
+
<h2><%= options[:heading] %> <span style="font-size: 14px">(generated for target '<%= options[:target] %>')</span></h2>
|
150
|
+
|
151
|
+
<div>
|
152
|
+
<!-- Nav tabs -->
|
153
|
+
<ul id="videoTabs" class="nav nav-tabs" role="tablist">
|
154
|
+
<li role="presentation" class="active"><a href="#listing" id="list-tab-select" aria-controls="listing" role="tab" data-toggle="tab">Datalog</a></li>
|
155
|
+
<li role="presentation"><a href="#flow" id="flow-tab-select" aria-controls="flow" role="tab" data-toggle="tab">Flow View</a></li>
|
156
|
+
</ul>
|
157
|
+
|
158
|
+
<!-- Tab panes -->
|
159
|
+
<div class="tab-content">
|
160
|
+
<div role="tabpanel" class="tab-pane active" id="listing" style="padding-top: 15px">
|
161
|
+
|
162
|
+
% formatter = OrigenDocHelpers::ListFlowFormatter.new
|
163
|
+
<%= formatter.open_table %>
|
164
|
+
% flows.each do |flow|
|
165
|
+
<%= formatter.run_and_format(program.flow(flow).ast, options[:context]) %>
|
166
|
+
% end
|
167
|
+
<%= formatter.close_table %>
|
168
|
+
|
169
|
+
</div>
|
170
|
+
|
171
|
+
<div role="tabpanel" class="tab-pane" id="flow" style="padding-top: 15px">
|
172
|
+
<div style="height: 40px;">
|
173
|
+
<span class="pull-right">
|
174
|
+
<a class="expand-all-link" href="#">expand all</a> |
|
175
|
+
<a class="collapse-all-link" href="#">collapse all</a>
|
176
|
+
</span>
|
177
|
+
</div>
|
178
|
+
|
179
|
+
% formatter = OrigenDocHelpers::HtmlFlowFormatter.new
|
180
|
+
% flows.each do |flow|
|
181
|
+
<%= formatter.run_and_format(program.flow(flow).ast, {evaluate_flow_flags: false, evaluate_run_flags: false, evaluate_set_result: false}.merge(options[:context])) %>
|
182
|
+
% end
|
183
|
+
|
184
|
+
</div>
|
185
|
+
</div>
|
186
|
+
</div>
|
187
|
+
</div>
|
188
|
+
</div>
|
189
|
+
|
190
|
+
% # Legacy output based on Doc tester, abandon hope all ye who enter here...
|
191
|
+
% else
|
192
|
+
|
7
193
|
<div class="row">
|
8
194
|
%# The markdown attribute is important if you are going to include content written
|
9
195
|
%# in markdown, without this is will be included verbatim
|
@@ -225,3 +411,5 @@
|
|
225
411
|
</div>
|
226
412
|
</div>
|
227
413
|
</div>
|
414
|
+
|
415
|
+
% end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: origen_doc_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen McGinty
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: origen
|
@@ -16,20 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
20
|
-
- - ">="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 0.2.1
|
19
|
+
version: '0.6'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
24
|
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: '0.
|
30
|
-
- - ">="
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 0.2.1
|
26
|
+
version: '0.6'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: origen_testers
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -61,6 +55,8 @@ files:
|
|
61
55
|
- lib/origen_doc_helpers.rb
|
62
56
|
- lib/origen_doc_helpers/doc_interface.rb
|
63
57
|
- lib/origen_doc_helpers/dut.rb
|
58
|
+
- lib/origen_doc_helpers/html_flow_formatter.rb
|
59
|
+
- lib/origen_doc_helpers/list_flow_formatter.rb
|
64
60
|
- lib/origen_doc_helpers/pdf.rb
|
65
61
|
- program/_func.rb
|
66
62
|
- program/_hvst.rb
|