w2tags 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +340 -0
- data/LICENSE +6 -0
- data/MIT-LICENSE +18 -0
- data/Manifest.txt +95 -0
- data/README.rdoc +264 -0
- data/Rakefile +23 -0
- data/VERSION +1 -0
- data/bin/w2tags +143 -0
- data/doc/ERB.HOT.rdoc +82 -0
- data/doc/FAQ.rdoc +81 -0
- data/doc/HAML.rdoc +310 -0
- data/doc/HOT.rdoc +137 -0
- data/doc/History.rdoc +757 -0
- data/doc/W2TAGS.rdoc +150 -0
- data/example/common.hot +11 -0
- data/example/from_readme.erb +78 -0
- data/example/from_readme.w2erb +64 -0
- data/example/from_w2tags.erb +32 -0
- data/example/from_w2tags.w2erb +32 -0
- data/example/rails_basic.hot +10 -0
- data/hot/erb.hot +156 -0
- data/hot/erb_form.hot +42 -0
- data/hot/erb_head.hot +15 -0
- data/hot/erb_jquery.hot +8 -0
- data/hot/erb_merb.hot +12 -0
- data/hot/erb_table.hot +43 -0
- data/hot/html.hot +31 -0
- data/hot/jquery.hot +88 -0
- data/hot/nvelocity.hot +23 -0
- data/hot/rails/sc_zebra.hot +10 -0
- data/hot/rails/scaffold.hot +15 -0
- data/hot/vm.hot +9 -0
- data/hot/vm2.hot +34 -0
- data/hot/vm_crud.hot +34 -0
- data/hot/vm_popup.hot +74 -0
- data/hot/xul.hot +114 -0
- data/lib/w2tags/block/plain_text.rb +57 -0
- data/lib/w2tags/block/remark.rb +37 -0
- data/lib/w2tags/block/sass.rb +66 -0
- data/lib/w2tags/merb_hook.rb +15 -0
- data/lib/w2tags/parser.rb +975 -0
- data/lib/w2tags/rails_hook.rb +15 -0
- data/lib/w2tags/sinatra_hook.rb +50 -0
- data/lib/w2tags.rb +100 -0
- data/plugins//w2tags//README +2 -0
- data/plugins//w2tags//generators//w2scaffold//USAGE +29 -0
- data/plugins//w2tags//generators//w2scaffold//templates//controller.rb +85 -0
- data/plugins//w2tags//generators//w2scaffold//templates//functional_test.rb +45 -0
- data/plugins//w2tags//generators//w2scaffold//templates//helper.rb +2 -0
- data/plugins//w2tags//generators//w2scaffold//templates//helper_test.rb +4 -0
- data/plugins//w2tags//generators//w2scaffold//templates//layout.html.erb +17 -0
- data/plugins//w2tags//generators//w2scaffold//templates//style.css +54 -0
- data/plugins//w2tags//generators//w2scaffold//templates//view_edit.html.erb +18 -0
- data/plugins//w2tags//generators//w2scaffold//templates//view_edit.html.w2erb +17 -0
- data/plugins//w2tags//generators//w2scaffold//templates//view_index.html.erb +24 -0
- data/plugins//w2tags//generators//w2scaffold//templates//view_index.html.w2erb +14 -0
- data/plugins//w2tags//generators//w2scaffold//templates//view_new.html.erb +17 -0
- data/plugins//w2tags//generators//w2scaffold//templates//view_new.html.w2erb +16 -0
- data/plugins//w2tags//generators//w2scaffold//templates//view_show.html.erb +10 -0
- data/plugins//w2tags//generators//w2scaffold//templates//view_show.html.w2erb +9 -0
- data/plugins//w2tags//generators//w2scaffold//w2scaffold_generator.rb +106 -0
- data/plugins//w2tags//install.rb +1 -0
- data/spec/spec_helper.rb +17 -0
- data/spec/w2tags_spec.rb +8 -0
- data/tasks/ann.rake +81 -0
- data/tasks/bones.rake +21 -0
- data/tasks/gem.rake +126 -0
- data/tasks/git.rake +41 -0
- data/tasks/manifest.rake +49 -0
- data/tasks/notes.rake +28 -0
- data/tasks/post_load.rake +39 -0
- data/tasks/rdoc.rake +51 -0
- data/tasks/rubyforge.rake +57 -0
- data/tasks/setup.rb +268 -0
- data/tasks/spec.rake +55 -0
- data/tasks/svn.rake +48 -0
- data/tasks/test.rake +38 -0
- data/test/enlightning.hot +3 -0
- data/test/feature.hot +28 -0
- data/test/parser_test.rb +203 -0
- data/test/tricky.hot +8 -0
- data/test/vars.hot +30 -0
- data/test/w2tags_basic_usability.rb +187 -0
- data/test/w2tags_enlightning.rb +42 -0
- data/test/w2tags_form.rb +32 -0
- data/test/w2tags_hot.rb +85 -0
- data/test/w2tags_hot_var.rb +115 -0
- data/test/w2tags_no_parsing.rb +37 -0
- metadata +163 -0
data/doc/W2TAGS.rdoc
ADDED
@@ -0,0 +1,150 @@
|
|
1
|
+
== W2TAGS extend HAML command
|
2
|
+
by Widi Harsojo, wharsojo.wordpress.com
|
3
|
+
|
4
|
+
in this guide I'll explain command not found or different with HAML (HAML.rdoc),
|
5
|
+
some of the explanation intermix with the explanation come from HOT (HOT.rdoc)
|
6
|
+
|
7
|
+
: input formating with attribute name
|
8
|
+
^ shortcut for NextTag in html
|
9
|
+
~^ re-assign shortcut for NextTag in html
|
10
|
+
< disable auto close tags when last params has char "<"
|
11
|
+
&var= define variable for it use later on params inside w2tags command
|
12
|
+
&var! use variable on params inside w2tags command
|
13
|
+
@var= define variable with uniq value for it use later on params inside w2tags command
|
14
|
+
@var! use variable with uniq value on params inside w2tags command
|
15
|
+
|
16
|
+
you can find all example on this guide inside file:
|
17
|
+
|
18
|
+
example/from_w2tags.w2erb
|
19
|
+
|
20
|
+
=== : input formating with attribute name
|
21
|
+
input is the tag that commonly use attribute "name", and I think its cool to have
|
22
|
+
the same behavior like HAML did in DIV to INPUT.
|
23
|
+
|
24
|
+
:test#wow.kereen{mak="nyos"} test
|
25
|
+
|
26
|
+
<input name="test" id="wow" class="kereen" mak="nyos">test</input>
|
27
|
+
|
28
|
+
=== ^ shortcut for NextTag in html
|
29
|
+
|
30
|
+
when you type <b>ul</b> tag, commonly it follow the <b>li</b> tag and this is the benefit of
|
31
|
+
using this command.
|
32
|
+
|
33
|
+
Predefine shortcut are:
|
34
|
+
|
35
|
+
%html => %head $*
|
36
|
+
%head => %body $*
|
37
|
+
%ol => %li $0
|
38
|
+
%ul => %li $0
|
39
|
+
%dl => %dt $0
|
40
|
+
%dd => %dt $0
|
41
|
+
%form => %input $0
|
42
|
+
%select => %option $0
|
43
|
+
%tr => %th $0 #first line
|
44
|
+
%tr => %td $0 #after first line
|
45
|
+
|
46
|
+
Basic Example:
|
47
|
+
|
48
|
+
%ul
|
49
|
+
^ this is a bullet list 1
|
50
|
+
^ this is a bullet list 2 ; this is a bullet list 3
|
51
|
+
|
52
|
+
<ul>
|
53
|
+
<li>this is a bullet list 1</li>
|
54
|
+
<li>this is a bullet list 2</li>
|
55
|
+
<li>this is a bullet list 3</li>
|
56
|
+
</ul>
|
57
|
+
|
58
|
+
With Attribute:
|
59
|
+
|
60
|
+
%ul
|
61
|
+
^.hilite{wow="kereen"} this is a bullet list 1
|
62
|
+
^.hilite{wow="kereen"} this is a bullet list 2 ; this is a bullet list 3
|
63
|
+
|
64
|
+
<ul>
|
65
|
+
<li class="hilite" wow="kereen">this is a bullet list 1</li>
|
66
|
+
<li class="hilite" wow="kereen">this is a bullet list 2</li>
|
67
|
+
<li class="hilite" wow="kereen">this is a bullet list 3</li>
|
68
|
+
</ul>
|
69
|
+
|
70
|
+
=== ~^ re-assign shortcut for NextTag in html
|
71
|
+
|
72
|
+
sometime I need result from shortcut for NextTag already include
|
73
|
+
class or attribut and this command play.
|
74
|
+
|
75
|
+
%ul
|
76
|
+
~^%li.hilite{wow="kereen"}
|
77
|
+
^ this is a bullet list 1
|
78
|
+
^ this is a bullet list 2 ; this is a bullet list 3
|
79
|
+
|
80
|
+
<ul>
|
81
|
+
<li class="hilite" wow="kereen">this is a bullet list 1</li>
|
82
|
+
<li class="hilite" wow="kereen">this is a bullet list 2</li>
|
83
|
+
<li class="hilite" wow="kereen">this is a bullet list 3</li>
|
84
|
+
</ul>
|
85
|
+
|
86
|
+
or you can put this command to a HOT file and it will use just like
|
87
|
+
regular W2TAGS command
|
88
|
+
|
89
|
+
>>_ul
|
90
|
+
%ul
|
91
|
+
~^%li.hilite{wow="kereen..."}
|
92
|
+
|
93
|
+
!hot!common
|
94
|
+
-ul
|
95
|
+
^ this is a bullet list 1
|
96
|
+
^ this is a bullet list 2 ; this is a bullet list 3
|
97
|
+
|
98
|
+
<ul>
|
99
|
+
<li class="hilite" wow="kereen...">this is a bullet list 1</li>
|
100
|
+
<li class="hilite" wow="kereen...">this is a bullet list 2</li>
|
101
|
+
<li class="hilite" wow="kereen...">this is a bullet list 3</li>
|
102
|
+
</ul>
|
103
|
+
|
104
|
+
=== < disable auto close tags when last params has char "<"
|
105
|
+
|
106
|
+
tag not automatically close when last params has char "<"
|
107
|
+
|
108
|
+
%div my note on inline params<
|
109
|
+
second note without tag
|
110
|
+
%div inside other div
|
111
|
+
|
112
|
+
<div>my note on inline params
|
113
|
+
second note without tag
|
114
|
+
<div>inside other div</div>
|
115
|
+
</div>
|
116
|
+
|
117
|
+
=== &var= define variable for it use later on params inside w2tags command
|
118
|
+
|
119
|
+
&myvar=wow kereen
|
120
|
+
|
121
|
+
=== &var! use variable on params inside w2tags command
|
122
|
+
|
123
|
+
.dodol &myvar!
|
124
|
+
|
125
|
+
<div class="dodol">wow kereen</div>
|
126
|
+
|
127
|
+
=== @var= define variable with uniq value for it use later on params inside w2tags command
|
128
|
+
|
129
|
+
@myvar=one;two;three
|
130
|
+
@myvar=five;three => one;two;three;five
|
131
|
+
|
132
|
+
when you assign value to this var with first char ";" it will reset the value
|
133
|
+
(not adding them)
|
134
|
+
|
135
|
+
@myvar=one;two;three
|
136
|
+
@myvar=five;three
|
137
|
+
@myvar=;three;two
|
138
|
+
@myvar=zero;two => three;two;zero
|
139
|
+
|
140
|
+
=== @var! use variable with uniq value on params inside w2tags command
|
141
|
+
|
142
|
+
%ul
|
143
|
+
^ @myvar!
|
144
|
+
|
145
|
+
<ul>
|
146
|
+
<li>three</li>
|
147
|
+
<li>two</li>
|
148
|
+
<li>zero</li>
|
149
|
+
</ul>
|
150
|
+
|
data/example/common.hot
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
<h2>Auto closing for Code</h2>
|
2
|
+
<% if index>100 %>
|
3
|
+
<div class="bigger">bigger than 100</div>
|
4
|
+
<% elsif index>50 %>
|
5
|
+
<div class="bigger">bigger than 50 but less than 100</div>
|
6
|
+
<% else %>
|
7
|
+
<div class="less">less than 50</div>
|
8
|
+
<% end %>
|
9
|
+
<div class="common">
|
10
|
+
Common Tag
|
11
|
+
</div>
|
12
|
+
<h2>Example 1 - HAML:</h2>
|
13
|
+
<div id="content">
|
14
|
+
<h1>menu</h1>
|
15
|
+
<ul>
|
16
|
+
<li>menu 1</li>
|
17
|
+
<li>menu 2</li>
|
18
|
+
</ul>
|
19
|
+
</div>
|
20
|
+
<div id="content">
|
21
|
+
<h1>menu</h1>
|
22
|
+
<ul>
|
23
|
+
^ menu 1; menu 2
|
24
|
+
</ul>
|
25
|
+
</div>
|
26
|
+
<div id="content">
|
27
|
+
<h1>menu</h1>
|
28
|
+
["</ul>"] <ul*attr*>
|
29
|
+
^menu 1; menu 2
|
30
|
+
</div>
|
31
|
+
<h2>Example 2 - Form input</h2>
|
32
|
+
<h1>New user</h1>
|
33
|
+
<%= error_messages_for :user %>
|
34
|
+
<% form_for @user do |f| %>
|
35
|
+
<p>
|
36
|
+
<b>Name</b>
|
37
|
+
<br/>
|
38
|
+
<%= f.text_field :name %>
|
39
|
+
</p>
|
40
|
+
<p>
|
41
|
+
<b>Email</b>
|
42
|
+
<br/>
|
43
|
+
<%= f.text_field :email %>
|
44
|
+
</p>
|
45
|
+
<p>
|
46
|
+
<b>Last login</b>
|
47
|
+
<br/>
|
48
|
+
<%= f.datetime_select :last_login %>
|
49
|
+
</p>
|
50
|
+
<p>
|
51
|
+
<%= f.submit "Create" %>
|
52
|
+
</p>
|
53
|
+
<% end %>
|
54
|
+
<%= link_to 'Back', users_path %>
|
55
|
+
<h2>Example 2 - Form input - REFACTOR</h2>
|
56
|
+
<h1>New user</h1>
|
57
|
+
<%= error_messages_for :user %>
|
58
|
+
<% form_for @user do |f| %>
|
59
|
+
<p>
|
60
|
+
<b>Name</b>
|
61
|
+
<br/>
|
62
|
+
<%= f.text_field :name %>
|
63
|
+
</p>
|
64
|
+
<p>
|
65
|
+
<b>Email</b>
|
66
|
+
<br/>
|
67
|
+
<%= f.text_field :email %>
|
68
|
+
</p>
|
69
|
+
<p>
|
70
|
+
<b>Last login</b>
|
71
|
+
<br/>
|
72
|
+
<%= f.text_field :last_login %>
|
73
|
+
</p>
|
74
|
+
<p>
|
75
|
+
<%= f.submit "Create" %>
|
76
|
+
</p>
|
77
|
+
<% end %>
|
78
|
+
<%= link_to 'Back', users_path %>
|
@@ -0,0 +1,64 @@
|
|
1
|
+
%h2 Auto closing for Code
|
2
|
+
-if index>100
|
3
|
+
.bigger bigger than 100
|
4
|
+
-elsif index>50
|
5
|
+
.bigger bigger than 50 but less than 100
|
6
|
+
-else
|
7
|
+
.less less than 50
|
8
|
+
|
9
|
+
.common
|
10
|
+
Common Tag
|
11
|
+
|
12
|
+
%h2 Example 1 - HAML:
|
13
|
+
#content
|
14
|
+
%h1 menu
|
15
|
+
%ul
|
16
|
+
%li menu 1
|
17
|
+
%li menu 2
|
18
|
+
|
19
|
+
#content
|
20
|
+
%h1 menu
|
21
|
+
%ul
|
22
|
+
^ menu 1; menu 2
|
23
|
+
|
24
|
+
!hot!common
|
25
|
+
#content
|
26
|
+
%h1 menu
|
27
|
+
-ul menu 1; menu 2
|
28
|
+
|
29
|
+
%h2 Example 2 - Form input
|
30
|
+
|
31
|
+
%h1 New user
|
32
|
+
|
33
|
+
= error_messages_for :user
|
34
|
+
|
35
|
+
-form_for @user do |f|
|
36
|
+
%p
|
37
|
+
%b Name
|
38
|
+
%br
|
39
|
+
= f.text_field :name
|
40
|
+
%p
|
41
|
+
%b Email
|
42
|
+
%br
|
43
|
+
= f.text_field :email
|
44
|
+
%p
|
45
|
+
%b Last login
|
46
|
+
%br
|
47
|
+
= f.datetime_select :last_login
|
48
|
+
|
49
|
+
%p
|
50
|
+
= f.submit "Create"
|
51
|
+
= link_to 'Back', users_path
|
52
|
+
|
53
|
+
%h2 Example 2 - Form input - REFACTOR
|
54
|
+
|
55
|
+
!hot!rails_basic
|
56
|
+
%h1 New user
|
57
|
+
|
58
|
+
= error_messages_for :user
|
59
|
+
|
60
|
+
-form_for @user do |f|
|
61
|
+
-input name;email;last_login
|
62
|
+
-submit Create
|
63
|
+
|
64
|
+
= link_to 'Back', users_path
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<input name="test" id="wow" class="kereen" mak="nyos">test</input>
|
2
|
+
<ul>
|
3
|
+
<li>this is a bullet list 1</li>
|
4
|
+
<li>this is a bullet list 2</li>
|
5
|
+
<li>this is a bullet list 3</li>
|
6
|
+
</ul>
|
7
|
+
<ul>
|
8
|
+
<li class="hilite" wow="kereen">this is a bullet list 1</li>
|
9
|
+
<li class="hilite" wow="kereen">this is a bullet list 2</li>
|
10
|
+
<li class="hilite" wow="kereen">this is a bullet list 3</li>
|
11
|
+
</ul>
|
12
|
+
<ul>
|
13
|
+
<li class="hilite" wow="kereen">this is a bullet list 1</li>
|
14
|
+
<li class="hilite" wow="kereen">this is a bullet list 2</li>
|
15
|
+
<li class="hilite" wow="kereen">this is a bullet list 3</li>
|
16
|
+
</ul>
|
17
|
+
<ul>
|
18
|
+
<li class="hilite" wow="kereen...">this is a bullet list 1</li>
|
19
|
+
<li class="hilite" wow="kereen...">this is a bullet list 2</li>
|
20
|
+
<li class="hilite" wow="kereen...">this is a bullet list 3</li>
|
21
|
+
</ul>
|
22
|
+
<div>my note on inline params
|
23
|
+
second note without tag
|
24
|
+
<div>inside other div</div>
|
25
|
+
</div>
|
26
|
+
<div class="dodol">wow kereen</div>
|
27
|
+
<ul>
|
28
|
+
<li>one</li>
|
29
|
+
<li>two</li>
|
30
|
+
<li>three</li>
|
31
|
+
<li>five</li>
|
32
|
+
</ul>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
:test#wow.kereen{mak="nyos"} test
|
2
|
+
|
3
|
+
%ul
|
4
|
+
^ this is a bullet list 1
|
5
|
+
^ this is a bullet list 2 ; this is a bullet list 3
|
6
|
+
|
7
|
+
%ul
|
8
|
+
^.hilite{wow="kereen"} this is a bullet list 1
|
9
|
+
^.hilite{wow="kereen"} this is a bullet list 2 ; this is a bullet list 3
|
10
|
+
|
11
|
+
%ul
|
12
|
+
~^%li.hilite{wow="kereen"}
|
13
|
+
^ this is a bullet list 1
|
14
|
+
^ this is a bullet list 2 ; this is a bullet list 3
|
15
|
+
|
16
|
+
!hot!common
|
17
|
+
-ul
|
18
|
+
^ this is a bullet list 1
|
19
|
+
^ this is a bullet list 2 ; this is a bullet list 3
|
20
|
+
|
21
|
+
|
22
|
+
%div my note on inline params<
|
23
|
+
second note without tag
|
24
|
+
%div inside other div
|
25
|
+
|
26
|
+
&myvar=wow kereen
|
27
|
+
.dodol &myvar!
|
28
|
+
|
29
|
+
@myvar=one;two;three
|
30
|
+
@myvar=five;three
|
31
|
+
%ul
|
32
|
+
^ @myvar!
|
data/hot/erb.hot
ADDED
@@ -0,0 +1,156 @@
|
|
1
|
+
>>initialize
|
2
|
+
|
3
|
+
|
4
|
+
>>finallize
|
5
|
+
,/
|
6
|
+
|
7
|
+
>>_merb_table
|
8
|
+
!hot!erb_merb
|
9
|
+
!hot!erb_table
|
10
|
+
!hot!erb_jquery
|
11
|
+
|
12
|
+
>>_merb_form
|
13
|
+
!hot!erb_merb
|
14
|
+
!hot!erb_form
|
15
|
+
!hot!erb_jquery
|
16
|
+
|
17
|
+
>>_if
|
18
|
+
- if $0
|
19
|
+
-end
|
20
|
+
|
21
|
+
>>_elsif
|
22
|
+
- elsif $0
|
23
|
+
-end
|
24
|
+
|
25
|
+
>>_else
|
26
|
+
- else
|
27
|
+
-end
|
28
|
+
|
29
|
+
>>_
|
30
|
+
!/
|
31
|
+
<% $* %>
|
32
|
+
|
33
|
+
>>_-
|
34
|
+
!/
|
35
|
+
<% $* %>
|
36
|
+
-end
|
37
|
+
|
38
|
+
>>=
|
39
|
+
!/
|
40
|
+
<%= $* %>
|
41
|
+
|
42
|
+
>>_=
|
43
|
+
!/
|
44
|
+
<%= $* %>
|
45
|
+
-end
|
46
|
+
|
47
|
+
>>_for
|
48
|
+
!/
|
49
|
+
<% for $* %>
|
50
|
+
-end
|
51
|
+
|
52
|
+
>>_each
|
53
|
+
!/
|
54
|
+
- $0.each do |$1|
|
55
|
+
-end
|
56
|
+
|
57
|
+
>>_eachs
|
58
|
+
!/
|
59
|
+
- $0.sort.each do |$1|
|
60
|
+
-end
|
61
|
+
|
62
|
+
>>_each2
|
63
|
+
!/
|
64
|
+
- $0.each_with_index do |$1|
|
65
|
+
-end
|
66
|
+
|
67
|
+
>>_times
|
68
|
+
!/
|
69
|
+
- $0.times do $1
|
70
|
+
-end
|
71
|
+
|
72
|
+
>>_end
|
73
|
+
<</
|
74
|
+
<% end %>
|
75
|
+
|
76
|
+
>>_a
|
77
|
+
%a$${href="*&"} $*
|
78
|
+
|
79
|
+
>>_a2
|
80
|
+
%a$${href="=$1"} $0
|
81
|
+
|
82
|
+
>>br
|
83
|
+
<br*all**@/>
|
84
|
+
|
85
|
+
>>hr
|
86
|
+
<hr*all**@/>
|
87
|
+
|
88
|
+
>>img
|
89
|
+
<img src="$0" ~alt="$1"~ />
|
90
|
+
|
91
|
+
>>img=
|
92
|
+
<img src="=$0" ~alt="$1"~ />
|
93
|
+
|
94
|
+
>>html_title
|
95
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
|
96
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us" >
|
97
|
+
<head>
|
98
|
+
<title>$0</title>
|
99
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
100
|
+
|
101
|
+
>>p_a
|
102
|
+
%p
|
103
|
+
%a $*
|
104
|
+
~/
|
105
|
+
|
106
|
+
>>r_each
|
107
|
+
!/
|
108
|
+
<% $1.each do |$0| %>
|
109
|
+
-end
|
110
|
+
|
111
|
+
>>for_in
|
112
|
+
!/
|
113
|
+
<% for $0 in $1 %>
|
114
|
+
-end
|
115
|
+
|
116
|
+
>>not
|
117
|
+
- unless $*
|
118
|
+
|
119
|
+
>>else
|
120
|
+
!/
|
121
|
+
<% else %>
|
122
|
+
-end
|
123
|
+
|
124
|
+
>>/
|
125
|
+
!/
|
126
|
+
<% end %>
|
127
|
+
|
128
|
+
>>_code
|
129
|
+
!/
|
130
|
+
-end_code
|
131
|
+
-!!
|
132
|
+
<%
|
133
|
+
|
134
|
+
>>_end_code
|
135
|
+
<</
|
136
|
+
%>
|
137
|
+
|
138
|
+
>>script
|
139
|
+
<script *all**@type="text/javascript" charset="utf-8">
|
140
|
+
%script_end
|
141
|
+
|
142
|
+
>>script_end
|
143
|
+
<</
|
144
|
+
</script>
|
145
|
+
|
146
|
+
>>input
|
147
|
+
<input *all*~value="$0"~/>
|
148
|
+
|
149
|
+
>>text
|
150
|
+
<input *all*type="text"~value="$0"~/>
|
151
|
+
|
152
|
+
>>submit
|
153
|
+
<input *all*type="submit"~value="$0"~/>
|
154
|
+
|
155
|
+
>>post
|
156
|
+
%form$:$#.lelouch.*.{*@method="post"~action="$0"~}
|
data/hot/erb_form.hot
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
>>form
|
2
|
+
%form{*name*method="post" |action="$0"|}!
|
3
|
+
&tbl=$1
|
4
|
+
|
5
|
+
>>__input
|
6
|
+
<div><label for="$#">$1</label></div>
|
7
|
+
<input id="&tbl!_$#" name="&tbl![$#]" type="$0" />
|
8
|
+
|
9
|
+
>>_input
|
10
|
+
-_input#$0 text;|$0|$1
|
11
|
+
|
12
|
+
>>_pass
|
13
|
+
-_input#$0 password;|$0|$1
|
14
|
+
|
15
|
+
>>_submit2
|
16
|
+
<input id="$0" type="submit" value="$0" />
|
17
|
+
|
18
|
+
>>_submit
|
19
|
+
%div
|
20
|
+
-submit2 $*
|
21
|
+
|
22
|
+
>>_form_e
|
23
|
+
&tbl=$1
|
24
|
+
%form{*name*method="post" |action="$0"|}!
|
25
|
+
-id_e id
|
26
|
+
|
27
|
+
>>__input_e
|
28
|
+
<div><label for="$#">$1</label></div>
|
29
|
+
<input id="&tbl!_$#" name="&tbl![$#]" type="$0" value="<%= @&tbl!.$# %>"/>
|
30
|
+
|
31
|
+
>>_hidden_e
|
32
|
+
<input id="&tbl!_$0" name="&tbl![$0]" type="hidden" value="<%= @&tbl!.$0 %>"/>
|
33
|
+
|
34
|
+
>>_id_e
|
35
|
+
<input id="$0" name="$0" type="hidden" value="<%= @&tbl!.$0 %>"/>
|
36
|
+
|
37
|
+
>>_input_e
|
38
|
+
-_input_e#$0 text;|$0|$1
|
39
|
+
|
40
|
+
>>_pass_e
|
41
|
+
-_input_e#$0 password;|$0|$1
|
42
|
+
|
data/hot/erb_head.hot
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
>>html
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us">
|
4
|
+
<</
|
5
|
+
</html>
|
6
|
+
|
7
|
+
>>utf8
|
8
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
|
9
|
+
|
10
|
+
>>css
|
11
|
+
<link rel="stylesheet" href="/stylesheets/$0.css" type="text/css" media="screen" charset="utf-8" />
|
12
|
+
|
13
|
+
>>js
|
14
|
+
<script type="text/javascript" src="/javascripts/$0.js" > </script>
|
15
|
+
|
data/hot/erb_jquery.hot
ADDED
data/hot/erb_merb.hot
ADDED
data/hot/erb_table.hot
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
>>_h1
|
2
|
+
#header-container
|
3
|
+
%h1 $0
|
4
|
+
%hr
|
5
|
+
|
6
|
+
>>table
|
7
|
+
!/
|
8
|
+
&tbl=$#
|
9
|
+
- @page = @&tbl!
|
10
|
+
-partial "partial/pagination"
|
11
|
+
<table *id* class="$. grid">
|
12
|
+
%table_end
|
13
|
+
|
14
|
+
>>table_end
|
15
|
+
<</
|
16
|
+
</table>
|
17
|
+
-partial "partial/pagination"
|
18
|
+
|
19
|
+
>>th
|
20
|
+
!/
|
21
|
+
<th *all*>$0</th>
|
22
|
+
|
23
|
+
>>tr_h
|
24
|
+
-header_tr $*
|
25
|
+
|
26
|
+
>>tr_d
|
27
|
+
-each_tr $*
|
28
|
+
|
29
|
+
>>_header_tr
|
30
|
+
%tr.header.c
|
31
|
+
%th $*
|
32
|
+
|
33
|
+
>>_each_tr
|
34
|
+
!/
|
35
|
+
<% @&tbl!.each_with_index do |r,i| -%>
|
36
|
+
<tr class="data" key="<%= r.id -%>">
|
37
|
+
%_each_tr_end
|
38
|
+
|
39
|
+
>>_each_tr_end
|
40
|
+
<</
|
41
|
+
</tr>
|
42
|
+
<% end %>
|
43
|
+
|
data/hot/html.hot
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
>>initialize
|
2
|
+
-! <!DOCTYPE html PUBLIC
|
3
|
+
-! "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" >
|
4
|
+
%html{xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"}
|
5
|
+
%head
|
6
|
+
!~
|
7
|
+
%body$*
|
8
|
+
|
9
|
+
>>finallize
|
10
|
+
,/
|
11
|
+
|
12
|
+
>>_utf-8
|
13
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
14
|
+
|
15
|
+
>>_feed
|
16
|
+
<link rel="alternate" href="$0" title="Primary Feed" type="application/atom+xml" />
|
17
|
+
|
18
|
+
>>css
|
19
|
+
<link rel="stylesheet" href="$0.css" type="text/css" media="screen, projection" />
|
20
|
+
|
21
|
+
>>js
|
22
|
+
<script type="text/javascript" src="$0.js" > </script>
|
23
|
+
|
24
|
+
>>_js
|
25
|
+
%js $0
|
26
|
+
|
27
|
+
>>_css
|
28
|
+
%css $0
|
29
|
+
|
30
|
+
>>input
|
31
|
+
<input *all*~value="$0"~/>
|