kwartz 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +340 -0
- data/ChangeLog +103 -0
- data/README.txt +37 -0
- data/bin/kwartz +12 -0
- data/doc-api/classes/Kwartz.html +218 -0
- data/doc-api/classes/Kwartz/Assertion.html +140 -0
- data/doc-api/classes/Kwartz/AssertionError.html +148 -0
- data/doc-api/classes/Kwartz/AttrInfo.html +320 -0
- data/doc-api/classes/Kwartz/BaseError.html +206 -0
- data/doc-api/classes/Kwartz/BaseTranslator.html +331 -0
- data/doc-api/classes/Kwartz/CharacterType.html +212 -0
- data/doc-api/classes/Kwartz/CommandOptionError.html +154 -0
- data/doc-api/classes/Kwartz/CommandOptions.html +374 -0
- data/doc-api/classes/Kwartz/Config.html +150 -0
- data/doc-api/classes/Kwartz/ConvertError.html +191 -0
- data/doc-api/classes/Kwartz/Converter.html +252 -0
- data/doc-api/classes/Kwartz/CssStyleParser.html +483 -0
- data/doc-api/classes/Kwartz/DocumentRuleset.html +369 -0
- data/doc-api/classes/Kwartz/ElementExpander.html +325 -0
- data/doc-api/classes/Kwartz/ElementInfo.html +312 -0
- data/doc-api/classes/Kwartz/ElementRuleset.html +582 -0
- data/doc-api/classes/Kwartz/EperlHandler.html +338 -0
- data/doc-api/classes/Kwartz/EperlTranslator.html +167 -0
- data/doc-api/classes/Kwartz/ErubisHandler.html +113 -0
- data/doc-api/classes/Kwartz/ErubisTranslator.html +168 -0
- data/doc-api/classes/Kwartz/ErubyHandler.html +337 -0
- data/doc-api/classes/Kwartz/ErubyTranslator.html +167 -0
- data/doc-api/classes/Kwartz/ExpandStatement.html +227 -0
- data/doc-api/classes/Kwartz/Expression.html +119 -0
- data/doc-api/classes/Kwartz/Handler.html +558 -0
- data/doc-api/classes/Kwartz/JstlHandler.html +657 -0
- data/doc-api/classes/Kwartz/JstlTranslator.html +226 -0
- data/doc-api/classes/Kwartz/KwartzError.html +146 -0
- data/doc-api/classes/Kwartz/Main.html +384 -0
- data/doc-api/classes/Kwartz/NativeExpression.html +236 -0
- data/doc-api/classes/Kwartz/NativeStatement.html +254 -0
- data/doc-api/classes/Kwartz/Node.html +156 -0
- data/doc-api/classes/Kwartz/ParseError.html +148 -0
- data/doc-api/classes/Kwartz/PhpHandler.html +333 -0
- data/doc-api/classes/Kwartz/PhpTranslator.html +194 -0
- data/doc-api/classes/Kwartz/PresentationLogicParser.html +830 -0
- data/doc-api/classes/Kwartz/PrintStatement.html +221 -0
- data/doc-api/classes/Kwartz/RailsHandler.html +587 -0
- data/doc-api/classes/Kwartz/RailsTranslator.html +167 -0
- data/doc-api/classes/Kwartz/RubyStyleParser.html +558 -0
- data/doc-api/classes/Kwartz/Ruleset.html +117 -0
- data/doc-api/classes/Kwartz/Statement.html +119 -0
- data/doc-api/classes/Kwartz/StrutsTranslator.html +190 -0
- data/doc-api/classes/Kwartz/TagInfo.html +314 -0
- data/doc-api/classes/Kwartz/TextConverter.html +270 -0
- data/doc-api/classes/Kwartz/Translator.html +318 -0
- data/doc-api/classes/Test.html +107 -0
- data/doc-api/classes/Test/Unit.html +101 -0
- data/doc-api/created.rid +1 -0
- data/doc-api/files/__/README_txt.html +150 -0
- data/doc-api/files/kwartz/assert_rb.html +114 -0
- data/doc-api/files/kwartz/binding/eperl_rb.html +116 -0
- data/doc-api/files/kwartz/binding/erubis_rb.html +116 -0
- data/doc-api/files/kwartz/binding/eruby_rb.html +115 -0
- data/doc-api/files/kwartz/binding/jstl_rb.html +116 -0
- data/doc-api/files/kwartz/binding/php_rb.html +116 -0
- data/doc-api/files/kwartz/binding/rails_rb.html +115 -0
- data/doc-api/files/kwartz/binding/struts_rb.html +117 -0
- data/doc-api/files/kwartz/config_rb.html +107 -0
- data/doc-api/files/kwartz/converter_rb.html +119 -0
- data/doc-api/files/kwartz/error_rb.html +107 -0
- data/doc-api/files/kwartz/main_rb.html +124 -0
- data/doc-api/files/kwartz/node_rb.html +114 -0
- data/doc-api/files/kwartz/parser_rb.html +117 -0
- data/doc-api/files/kwartz/translator_rb.html +115 -0
- data/doc-api/files/kwartz/util/assert-text-equal_rb.html +115 -0
- data/doc-api/files/kwartz/util/testcase-helper_rb.html +115 -0
- data/doc-api/files/kwartz_rb.html +120 -0
- data/doc-api/fr_class_index.html +75 -0
- data/doc-api/fr_file_index.html +45 -0
- data/doc-api/fr_method_index.html +216 -0
- data/doc-api/index.html +24 -0
- data/doc-api/rdoc-style.css +208 -0
- data/doc/docstyle.css +188 -0
- data/doc/p-pattern.html +1207 -0
- data/doc/reference.html +3396 -0
- data/doc/users-guide.html +1670 -0
- data/examples/breadcrumbs1/Makefile +15 -0
- data/examples/breadcrumbs1/breadcrumbs.eruby.plogic +27 -0
- data/examples/breadcrumbs1/breadcrumbs.html +12 -0
- data/examples/breadcrumbs1/breadcrumbs.jstl.plogic +28 -0
- data/examples/breadcrumbs1/breadcrumbs.php.plogic +26 -0
- data/examples/breadcrumbs1/main.php +12 -0
- data/examples/breadcrumbs1/main.rb +12 -0
- data/examples/breadcrumbs2/Makefile +15 -0
- data/examples/breadcrumbs2/breadcrumbs.eruby.plogic +22 -0
- data/examples/breadcrumbs2/breadcrumbs.html +14 -0
- data/examples/breadcrumbs2/breadcrumbs.jstl.plogic +24 -0
- data/examples/breadcrumbs2/breadcrumbs.php.plogic +23 -0
- data/examples/breadcrumbs2/main.php +12 -0
- data/examples/breadcrumbs2/main.rb +12 -0
- data/examples/pagelayout/Makefile +47 -0
- data/examples/pagelayout/content.eruby.plogic +44 -0
- data/examples/pagelayout/content.jstl.plogic +36 -0
- data/examples/pagelayout/content.php.plogic +37 -0
- data/examples/pagelayout/content1.html +36 -0
- data/examples/pagelayout/content2.html +29 -0
- data/examples/pagelayout/design.css +40 -0
- data/examples/pagelayout/layout.html +50 -0
- data/examples/pagelayout/main.php +55 -0
- data/examples/pagelayout/main.rb +77 -0
- data/examples/pagelayout/menu.eruby.plogic +14 -0
- data/examples/pagelayout/menu.html +13 -0
- data/examples/pagelayout/menu.jstl.plogic +14 -0
- data/examples/pagelayout/menu.php.plogic +14 -0
- data/examples/rails1/Makefile +36 -0
- data/examples/rails1/README +19 -0
- data/examples/rails1/application_helper.rb +31 -0
- data/examples/rails1/edit.html +28 -0
- data/examples/rails1/edit.plogic +10 -0
- data/examples/rails1/form.html +52 -0
- data/examples/rails1/form.plogic +33 -0
- data/examples/rails1/layout.plogic +15 -0
- data/examples/rails1/link_to.plogic +19 -0
- data/examples/rails1/list.html +48 -0
- data/examples/rails1/list.plogic +28 -0
- data/examples/rails1/new.html +27 -0
- data/examples/rails1/new.plogic +10 -0
- data/examples/rails1/reader.plogic +29 -0
- data/examples/rails1/show.html +40 -0
- data/examples/rails1/show.plogic +4 -0
- data/examples/rails1/writer.plogic +8 -0
- data/examples/table1/Makefile +15 -0
- data/examples/table1/main.php +11 -0
- data/examples/table1/main.rb +11 -0
- data/examples/table1/table1.eruby.plogic +21 -0
- data/examples/table1/table1.html +16 -0
- data/examples/table1/table1.jstl.plogic +21 -0
- data/examples/table1/table1.php.plogic +22 -0
- data/kwartz.gemspec +55 -0
- data/lib/kwartz.rb +13 -0
- data/lib/kwartz/assert.rb +31 -0
- data/lib/kwartz/binding/eperl.rb +166 -0
- data/lib/kwartz/binding/erubis.rb +61 -0
- data/lib/kwartz/binding/eruby.rb +164 -0
- data/lib/kwartz/binding/jstl.rb +334 -0
- data/lib/kwartz/binding/php.rb +167 -0
- data/lib/kwartz/binding/rails.rb +295 -0
- data/lib/kwartz/binding/struts.rb +109 -0
- data/lib/kwartz/config.rb +28 -0
- data/lib/kwartz/converter.rb +920 -0
- data/lib/kwartz/error.rb +41 -0
- data/lib/kwartz/main.rb +464 -0
- data/lib/kwartz/node.rb +454 -0
- data/lib/kwartz/parser.rb +903 -0
- data/lib/kwartz/translator.rb +153 -0
- data/lib/kwartz/util/assert-text-equal.rb +44 -0
- data/lib/kwartz/util/testcase-helper.rb +112 -0
- data/setup.rb +1331 -0
- data/test/test-compile.rb +36 -0
- data/test/test-compile.yaml +178 -0
- data/test/test-converter.rb +34 -0
- data/test/test-converter.yaml +127 -0
- data/test/test-directives.rb +32 -0
- data/test/test-directives.yaml +1411 -0
- data/test/test-main.rb +464 -0
- data/test/test-parser.rb +54 -0
- data/test/test-parser.yaml +394 -0
- data/test/test-rails.rb +28 -0
- data/test/test-rails.yaml +301 -0
- data/test/test-ruleset.rb +36 -0
- data/test/test-ruleset.yaml +804 -0
- data/test/test.rb +44 -0
- metadata +236 -0
@@ -0,0 +1,28 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title></title>
|
5
|
+
<link rel="stylesheet" type="text/css" href="scaffold.css">
|
6
|
+
</head>
|
7
|
+
<body>
|
8
|
+
|
9
|
+
<div id="page_content">
|
10
|
+
|
11
|
+
<h1>Editing member</h1>
|
12
|
+
|
13
|
+
<form action="update" id="form_for_update">
|
14
|
+
|
15
|
+
<div id="replace_element_by_form_content">
|
16
|
+
<p>Name: <input type="text"></p>
|
17
|
+
<p>Email: <input type="text"></p>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<input type="submit" id="mark:submit">
|
21
|
+
</form>
|
22
|
+
|
23
|
+
<a href="#" id="link_to_show">Show</a> | <a href="#" id="link_to_list">List</a>
|
24
|
+
|
25
|
+
</div>
|
26
|
+
|
27
|
+
</body>
|
28
|
+
</html>
|
@@ -0,0 +1,52 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title id="mark:header_title">Member: enter</title>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html">
|
6
|
+
<link id="mark:stylesheet" rel="stylesheet" type="text/css" href="scaffold.css" />
|
7
|
+
</head>
|
8
|
+
<body>
|
9
|
+
|
10
|
+
<p style="color: green" id="mark:flash"></p>
|
11
|
+
|
12
|
+
<div id="content_for_layout">
|
13
|
+
|
14
|
+
<h1>Enter Member</h1>
|
15
|
+
|
16
|
+
<div id="form_content">
|
17
|
+
|
18
|
+
<div id="mark:error_messages"></div>
|
19
|
+
|
20
|
+
<!--[form:member]-->
|
21
|
+
<p><label for="member_name">Name</label><br>
|
22
|
+
<input type="text" id="member_name"></p>
|
23
|
+
|
24
|
+
<p><label for="member_email">Email</label><br>
|
25
|
+
<input type="text" id="member_email"></p>
|
26
|
+
|
27
|
+
<p><label for="member_birth">Birth</label><br>
|
28
|
+
<select id="member_birth">
|
29
|
+
<option value=""> - <option>
|
30
|
+
</select>
|
31
|
+
</p>
|
32
|
+
|
33
|
+
<p><label for="member_gender">Gender</label><br>
|
34
|
+
<input type="radio" id="member_gender_m"><label for="member_gender_m">Man</label>
|
35
|
+
<input type="radio" id="member_gender_w"><label for="member_gender_w">Woman</label>
|
36
|
+
</p>
|
37
|
+
|
38
|
+
<p><label for="member_group_id">Group</label><br>
|
39
|
+
<select id="member_group_id">
|
40
|
+
<option value=""> - </option>
|
41
|
+
<option value="1">group1</option>
|
42
|
+
<option value="2">group2</option>
|
43
|
+
</select>
|
44
|
+
</p>
|
45
|
+
<!--[eoform:member]-->
|
46
|
+
|
47
|
+
</div>
|
48
|
+
|
49
|
+
</div>
|
50
|
+
|
51
|
+
</body>
|
52
|
+
</html>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
@import 'layout.plogic';
|
2
|
+
|
3
|
+
|
4
|
+
#error_messages {
|
5
|
+
elem: error_messages_for 'member';
|
6
|
+
}
|
7
|
+
|
8
|
+
#member_name {
|
9
|
+
elem: text_field 'member', 'name';
|
10
|
+
}
|
11
|
+
|
12
|
+
#member_email {
|
13
|
+
elem: text_field 'member', 'email';
|
14
|
+
}
|
15
|
+
|
16
|
+
#member_birth {
|
17
|
+
elem: date_select 'member', 'birth';
|
18
|
+
}
|
19
|
+
|
20
|
+
#member_gender_m {
|
21
|
+
elem: radio_button 'member', 'gender', 'M';
|
22
|
+
}
|
23
|
+
#member_gender_w {
|
24
|
+
elem: radio_button 'member', 'gender', 'W';
|
25
|
+
}
|
26
|
+
|
27
|
+
#member_group_id {
|
28
|
+
elem: select 'member', 'group_id', group_options, :include_blank=>true;
|
29
|
+
logic: {
|
30
|
+
group_options = Group.find_all().collect {|g| [g.name, g.id]}
|
31
|
+
_elem
|
32
|
+
}
|
33
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#link_to_list {
|
2
|
+
stag: start_link_to :action=>'list';
|
3
|
+
}
|
4
|
+
|
5
|
+
#link_to_new {
|
6
|
+
stag: start_link_to :action=>'new';
|
7
|
+
}
|
8
|
+
|
9
|
+
#link_to_show {
|
10
|
+
stag: start_link_to :action=>'show', :id=>@member.id;
|
11
|
+
}
|
12
|
+
|
13
|
+
#link_to_edit {
|
14
|
+
stag: start_link_to :action=>'edit', :id=>@member.id;
|
15
|
+
}
|
16
|
+
|
17
|
+
#link_to_destroy {
|
18
|
+
stag: start_link_to({:action=>'destroy', :id=>@member.id}, :confirm=>'Are you sure?');
|
19
|
+
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title></title>
|
5
|
+
<link rel="stylesheet" type="text/css" href="scaffold.css">
|
6
|
+
</head>
|
7
|
+
<body>
|
8
|
+
|
9
|
+
<div id="mark:page_content">
|
10
|
+
|
11
|
+
<h1>Listing members</h1>
|
12
|
+
|
13
|
+
<table summary="">
|
14
|
+
|
15
|
+
<tr>
|
16
|
+
<th>Name</th>
|
17
|
+
<th>Email</th>
|
18
|
+
<th>Birth</th>
|
19
|
+
<th>Gender</th>
|
20
|
+
<th>Group</th>
|
21
|
+
</tr>
|
22
|
+
|
23
|
+
<tr id="mark:members">
|
24
|
+
<td id="mark:member_name">foo</td>
|
25
|
+
<td id="mark:member_email">foo@mail.com</td>
|
26
|
+
<td id="mark:member_birth">2000-01-01</td>
|
27
|
+
<td id="mark:member_gender">Woman</td>
|
28
|
+
<td id="mark:member_group">admin</td>
|
29
|
+
<td>
|
30
|
+
<a href="#" id="link_to_show">Show</a>
|
31
|
+
<a href="#" id="link_to_edit">Edit</a>
|
32
|
+
<a href="#" id="link_to_destroy">Destroy</a>
|
33
|
+
</td>
|
34
|
+
</tr>
|
35
|
+
|
36
|
+
</table>
|
37
|
+
|
38
|
+
<a href="#" id="prev_page">Previous page</a>
|
39
|
+
<a href="#" id="next_page">Next page</a>
|
40
|
+
|
41
|
+
<br />
|
42
|
+
|
43
|
+
<a href="#" id="link_to_new">New member</a>
|
44
|
+
|
45
|
+
</div>
|
46
|
+
|
47
|
+
</body>
|
48
|
+
</html>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
@import 'link_to.plogic';
|
2
|
+
@import 'reader.plogic';
|
3
|
+
|
4
|
+
#members {
|
5
|
+
logic: {
|
6
|
+
for @member in @members
|
7
|
+
_elem
|
8
|
+
end
|
9
|
+
}
|
10
|
+
}
|
11
|
+
|
12
|
+
#prev_page {
|
13
|
+
elem: start_link_to({:page=>@member_pages.current.previous});
|
14
|
+
logic: {
|
15
|
+
if @member_pages.current.previous
|
16
|
+
_elem
|
17
|
+
end
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
#next_page {
|
22
|
+
elem: start_link_to({:page=>@member_pages.current.next});
|
23
|
+
logic: {
|
24
|
+
if @member_pages.current.next
|
25
|
+
_elem
|
26
|
+
end
|
27
|
+
}
|
28
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title></title>
|
5
|
+
<link rel="stylesheet" type="text/css" href="scaffold.css">
|
6
|
+
</head>
|
7
|
+
<body>
|
8
|
+
|
9
|
+
<div id="page_content">
|
10
|
+
|
11
|
+
<h1>New member</h1>
|
12
|
+
|
13
|
+
<form action="create" id="form_for_create">
|
14
|
+
|
15
|
+
<span id="replace_element_by_form_content">
|
16
|
+
...
|
17
|
+
</span>
|
18
|
+
|
19
|
+
<input type="submit" id="submit">
|
20
|
+
</form>
|
21
|
+
|
22
|
+
<a href="#" id="link_to_list">Back</a>
|
23
|
+
|
24
|
+
</div>
|
25
|
+
|
26
|
+
</body>
|
27
|
+
</html>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
|
2
|
+
#member_name {
|
3
|
+
Value: @member.name;
|
4
|
+
}
|
5
|
+
|
6
|
+
#member_email {
|
7
|
+
Value: @member.email;
|
8
|
+
}
|
9
|
+
|
10
|
+
#member_birth {
|
11
|
+
value: @member.birth;
|
12
|
+
}
|
13
|
+
|
14
|
+
#member_gender {
|
15
|
+
value: label;
|
16
|
+
logic: {
|
17
|
+
case @member.gender
|
18
|
+
when 'M' ; label = 'Man'
|
19
|
+
when 'W' ; label = 'Woman'
|
20
|
+
else ; label = ' - '
|
21
|
+
end
|
22
|
+
_elem
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
#member_group {
|
27
|
+
Value: @member.group.name;
|
28
|
+
}
|
29
|
+
|
@@ -0,0 +1,40 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title></title>
|
5
|
+
<link rel="stylesheet" type="text/css" href="scaffold.css">
|
6
|
+
</head>
|
7
|
+
<body>
|
8
|
+
|
9
|
+
<div id="page_content">
|
10
|
+
<p>
|
11
|
+
<b>Name:</b>
|
12
|
+
<span id="mark:member_name">Foo</span>
|
13
|
+
</p>
|
14
|
+
|
15
|
+
<p>
|
16
|
+
<b>Email:</b>
|
17
|
+
<span id="mark:member_email">foo@mail.com</span>
|
18
|
+
</p>
|
19
|
+
|
20
|
+
<p>
|
21
|
+
<b>Birth:</b>
|
22
|
+
<span id="mark:member_birth">2000-01-01</span>
|
23
|
+
</p>
|
24
|
+
|
25
|
+
<p>
|
26
|
+
<b>Gender:</b>
|
27
|
+
<span id="mark:member_gender">Woman</span>
|
28
|
+
</p>
|
29
|
+
|
30
|
+
<p>
|
31
|
+
<b>Group:</b>
|
32
|
+
<span id="mark:member_group">admin</span>
|
33
|
+
</p>
|
34
|
+
|
35
|
+
<a href="#" id="link_to_edit">Edit</a> |
|
36
|
+
<a href="#" id="link_to_list">Back</a>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
</body>
|
40
|
+
</html>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
ALL = table1.rhtml table1.php table1.jsp
|
2
|
+
|
3
|
+
all: ${ALL}
|
4
|
+
|
5
|
+
clean:
|
6
|
+
rm -f ${ALL}
|
7
|
+
|
8
|
+
table1.rhtml: table1.eruby.plogic table1.html
|
9
|
+
kwartz -l eruby -p table1.eruby.plogic table1.html > table1.rhtml
|
10
|
+
|
11
|
+
table1.php: table1.php.plogic table1.html
|
12
|
+
kwartz -l php -p table1.php.plogic table1.html > table1.php
|
13
|
+
|
14
|
+
table1.jsp: table1.jstl.plogic table1.html
|
15
|
+
kwartz -l jstl -p table1.jstl.plogic table1.html > table1.jsp
|
@@ -0,0 +1,11 @@
|
|
1
|
+
list = [
|
2
|
+
{ :name=>"Nomo", :mail=>"hideo@mail.com" },
|
3
|
+
{ :name=>"Ichiro", :mail=>"ichiro@mail.net" },
|
4
|
+
{ :name=>"Matsui", :mail=>"hideki@mail.org" },
|
5
|
+
]
|
6
|
+
|
7
|
+
require 'erb'
|
8
|
+
str = File.read('table1.rhtml')
|
9
|
+
trim_mode = 1
|
10
|
+
erb = ERB.new(str, $SAFE, trim_mode)
|
11
|
+
print erb.result(binding())
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#row {
|
2
|
+
attrs: "bgcolor" color;
|
3
|
+
logic: {
|
4
|
+
list.each_with_index { |item, i|
|
5
|
+
color = i % 2 == 0 ? '#CCCCFF' : '#FFCCCC';
|
6
|
+
_elem
|
7
|
+
}
|
8
|
+
}
|
9
|
+
}
|
10
|
+
|
11
|
+
#name {
|
12
|
+
value: item[:name];
|
13
|
+
}
|
14
|
+
|
15
|
+
#mail {
|
16
|
+
value: item[:mail];
|
17
|
+
}
|
18
|
+
|
19
|
+
#dummy1 {
|
20
|
+
logic: { } /* ignore this element */
|
21
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<html>
|
2
|
+
<body>
|
3
|
+
|
4
|
+
<table>
|
5
|
+
<tr bgcolor="#CCCCFF" id="mark:row">
|
6
|
+
<td id="mark:name">Foo</td>
|
7
|
+
<td id="mark:mail">foo@mail.com</td>
|
8
|
+
</tr>
|
9
|
+
<tr bgcolor="#FFCCCC" id="mark:dummy1">
|
10
|
+
<td>Bar</td>
|
11
|
+
<td>bar@mail.org</td>
|
12
|
+
</tr>
|
13
|
+
</table>
|
14
|
+
|
15
|
+
</body>
|
16
|
+
</html>
|