markaby 0.3 → 0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/markaby.rb +2 -2
- data/lib/markaby/builder.rb +57 -33
- data/lib/markaby/tags.rb +1 -0
- data/test/test_markaby.rb +21 -16
- metadata +4 -63
- data/doc/rdoc/classes/Markaby.html +0 -192
- data/doc/rdoc/classes/Markaby/ActionControllerHelper.html +0 -145
- data/doc/rdoc/classes/Markaby/ActionControllerHelper.src/M000005.html +0 -20
- data/doc/rdoc/classes/Markaby/Builder.html +0 -480
- data/doc/rdoc/classes/Markaby/Builder.src/M000008.html +0 -44
- data/doc/rdoc/classes/Markaby/Builder.src/M000009.html +0 -18
- data/doc/rdoc/classes/Markaby/Builder.src/M000010.html +0 -19
- data/doc/rdoc/classes/Markaby/Builder.src/M000012.html +0 -24
- data/doc/rdoc/classes/Markaby/Builder.src/M000013.html +0 -18
- data/doc/rdoc/classes/Markaby/Builder.src/M000014.html +0 -22
- data/doc/rdoc/classes/Markaby/Builder.src/M000015.html +0 -38
- data/doc/rdoc/classes/Markaby/Builder.src/M000016.html +0 -18
- data/doc/rdoc/classes/Markaby/Builder.src/M000017.html +0 -18
- data/doc/rdoc/classes/Markaby/Builder.src/M000018.html +0 -21
- data/doc/rdoc/classes/Markaby/Builder.src/M000019.html +0 -24
- data/doc/rdoc/classes/Markaby/Builder.src/M000021.html +0 -18
- data/doc/rdoc/classes/Markaby/CssProxy.html +0 -177
- data/doc/rdoc/classes/Markaby/CssProxy.src/M000006.html +0 -19
- data/doc/rdoc/classes/Markaby/CssProxy.src/M000007.html +0 -33
- data/doc/rdoc/classes/Markaby/Template.html +0 -156
- data/doc/rdoc/classes/Markaby/Template.src/M000022.html +0 -18
- data/doc/rdoc/classes/Markaby/Template.src/M000023.html +0 -20
- data/doc/rdoc/classes/Markaby/View.html +0 -156
- data/doc/rdoc/classes/Markaby/View.src/M000024.html +0 -18
- data/doc/rdoc/classes/Markaby/View.src/M000025.html +0 -18
- data/doc/rdoc/classes/Object.html +0 -199
- data/doc/rdoc/classes/Object.src/M000001.html +0 -16
- data/doc/rdoc/classes/Object.src/M000002.html +0 -16
- data/doc/rdoc/classes/Object.src/M000003.html +0 -18
- data/doc/rdoc/classes/Object.src/M000004.html +0 -18
- data/doc/rdoc/created.rid +0 -1
- data/doc/rdoc/files/CHANGELOG.html +0 -136
- data/doc/rdoc/files/README.html +0 -326
- data/doc/rdoc/files/lib/markaby/builder_rb.html +0 -101
- data/doc/rdoc/files/lib/markaby/cssproxy_rb.html +0 -101
- data/doc/rdoc/files/lib/markaby/helper_rb.html +0 -101
- data/doc/rdoc/files/lib/markaby/metaid_rb.html +0 -107
- data/doc/rdoc/files/lib/markaby/tags_rb.html +0 -101
- data/doc/rdoc/files/lib/markaby/template_rb.html +0 -101
- data/doc/rdoc/files/lib/markaby/view_rb.html +0 -101
- data/doc/rdoc/files/lib/markaby_rb.html +0 -127
- data/doc/rdoc/fr_class_index.html +0 -33
- data/doc/rdoc/fr_file_index.html +0 -36
- data/doc/rdoc/fr_method_index.html +0 -51
- data/doc/rdoc/index.html +0 -24
- data/doc/rdoc/rdoc-style.css +0 -208
- data/test/example.rb +0 -48
data/Rakefile
CHANGED
@@ -12,4 +12,4 @@ setup_rdoc ['README', 'CHANGELOG', 'lib/**/*.rb']
|
|
12
12
|
|
13
13
|
summary = "Markup as Ruby, write HTML in your native Ruby tongue"
|
14
14
|
test_file = "test/test_markaby.rb"
|
15
|
-
setup_gem("markaby", "0.
|
15
|
+
setup_gem("markaby", "0.4", "Tim Fletcher and _why", summary, ['builder'], test_file)
|
data/lib/markaby.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# = About lib/
|
1
|
+
# = About lib/markaby.rb
|
2
2
|
#
|
3
3
|
# By requiring <tt>lib/markaby</tt>, you can load Markaby's dependency (the Builder library,)
|
4
4
|
# as well as the full set of Markaby classes.
|
@@ -19,7 +19,7 @@ $:.unshift File.expand_path(File.dirname(__FILE__))
|
|
19
19
|
# * Markaby::Template: a class for hooking Markaby into Rails as a
|
20
20
|
# proper templating language.
|
21
21
|
module Markaby
|
22
|
-
|
22
|
+
VERSION = '0.4'
|
23
23
|
end
|
24
24
|
|
25
25
|
unless defined?(Builder)
|
data/lib/markaby/builder.rb
CHANGED
@@ -18,6 +18,22 @@ module Markaby
|
|
18
18
|
#
|
19
19
|
class Builder
|
20
20
|
|
21
|
+
@@default = {
|
22
|
+
:indent => 2,
|
23
|
+
:output_helpers => true,
|
24
|
+
:output_xml_instruction => true,
|
25
|
+
:output_meta_tag => true,
|
26
|
+
:image_tag_options => { :border => '0', :alt => '' }
|
27
|
+
}
|
28
|
+
|
29
|
+
def self.set(option, value)
|
30
|
+
@@default[option] = value
|
31
|
+
end
|
32
|
+
|
33
|
+
XHTMLTransitional = ["-//W3C//DTD XHTML 1.0 Transitional//EN", "DTD/xhtml1-transitional.dtd"]
|
34
|
+
|
35
|
+
XHTMLStrict = ["-//W3C//DTD XHTML 1.0 Strict//EN", "DTD/xhtml1-strict.dtd"]
|
36
|
+
|
21
37
|
attr_accessor :output_helpers
|
22
38
|
|
23
39
|
# Create a Markaby builder object. Pass in a hash of variable assignments to
|
@@ -38,8 +54,12 @@ module Markaby
|
|
38
54
|
def initialize(assigns = {}, helpers = nil, &block)
|
39
55
|
@stream = []
|
40
56
|
@assigns = assigns
|
41
|
-
@
|
42
|
-
|
57
|
+
@margin = -1
|
58
|
+
|
59
|
+
@indent = @@default[:indent]
|
60
|
+
@output_helpers = @@default[:output_helpers]
|
61
|
+
@output_meta_tag = @@default[:output_meta_tag]
|
62
|
+
@output_xml_instruction = @@default[:output_xml_instruction]
|
43
63
|
|
44
64
|
if helpers.nil?
|
45
65
|
@helpers = nil
|
@@ -59,6 +79,9 @@ module Markaby
|
|
59
79
|
end
|
60
80
|
end
|
61
81
|
|
82
|
+
@margin += 1
|
83
|
+
@builder = ::Builder::XmlMarkup.new(:indent => @indent, :margin => @margin, :target => @stream)
|
84
|
+
|
62
85
|
if block
|
63
86
|
r = instance_eval &block
|
64
87
|
text(r) if to_s.empty?
|
@@ -67,7 +90,7 @@ module Markaby
|
|
67
90
|
|
68
91
|
# Returns a string containing the HTML stream. Internally, the stream is stored as an Array.
|
69
92
|
def to_s
|
70
|
-
@
|
93
|
+
@stream.join
|
71
94
|
end
|
72
95
|
|
73
96
|
# Write a +string+ to the HTML stream without escaping it.
|
@@ -76,21 +99,24 @@ module Markaby
|
|
76
99
|
nil
|
77
100
|
end
|
78
101
|
alias_method :<<, :text
|
102
|
+
alias_method :concat, :text
|
103
|
+
|
104
|
+
# Emulate ERB to satisfy helpers like <tt>form_for</tt>.
|
105
|
+
def _erbout; self end
|
79
106
|
|
80
107
|
# Captures the HTML code built inside the +block+. This is done by creating a new
|
81
|
-
# builder object, running the block and passing back its stream as a string.
|
108
|
+
# stream for the builder object, running the block and passing back its stream as a string.
|
82
109
|
#
|
83
110
|
# >> Markaby::Builder.new.capture { h1 "TEST"; h2 "CAPTURE ME" }
|
84
111
|
# => "<h1>TITLE</h1>\n<h2>CAPTURE ME</h2>\n"
|
85
112
|
#
|
86
113
|
def capture(&block)
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
self.class.new(assigns, @helpers, &block).to_s
|
114
|
+
old_stream = @stream.dup
|
115
|
+
@stream.replace []
|
116
|
+
str = instance_eval(&block).to_s
|
117
|
+
str = @stream.join unless @stream.empty?
|
118
|
+
@stream.replace old_stream
|
119
|
+
str
|
94
120
|
end
|
95
121
|
|
96
122
|
# Content_for will store the given block in an instance variable for later use
|
@@ -136,45 +162,45 @@ module Markaby
|
|
136
162
|
# and output to the stream.
|
137
163
|
# * Otherwise, +sym+ and its arguments are passed to tag!
|
138
164
|
def method_missing(sym, *args, &block)
|
139
|
-
|
140
|
-
@stream.delete_if { |x| x.object_id == arg.object_id }
|
141
|
-
end
|
142
|
-
if TAGS.include?(sym)
|
165
|
+
if TAGS.include?(sym) or (FORM_TAGS.include?(sym) and args.empty?)
|
143
166
|
if args.empty? and block.nil?
|
144
167
|
return CssProxy.new do |args, block|
|
168
|
+
if FORM_TAGS.include?(sym) and args.last.respond_to?(:to_hash) and args.last[:id]
|
169
|
+
args.last[:name] ||= args.last[:id]
|
170
|
+
end
|
145
171
|
tag!(sym, *args, &block)
|
146
172
|
end
|
147
173
|
end
|
174
|
+
if args.first.respond_to? :to_hash
|
175
|
+
block ||= proc{}
|
176
|
+
end
|
148
177
|
tag!(sym, *args, &block)
|
149
178
|
elsif SELF_CLOSING_TAGS.include?(sym)
|
150
179
|
tag!(sym, *args)
|
151
|
-
elsif instance_variable_get("@#{sym}")
|
152
|
-
instance_variable_get("@#{sym}")
|
153
180
|
elsif @helpers.respond_to?(sym)
|
154
181
|
r = @helpers.send(sym, *args, &block)
|
155
182
|
@builder << r if @output_helpers
|
156
183
|
r
|
184
|
+
elsif instance_variable_get("@#{sym}")
|
185
|
+
instance_variable_get("@#{sym}")
|
157
186
|
else
|
158
187
|
tag!(sym, *args, &block)
|
159
188
|
end
|
160
189
|
end
|
161
190
|
|
162
|
-
|
163
|
-
|
164
|
-
end
|
165
|
-
|
166
|
-
@@default_image_tag_options ||= { :border => '0', :alt => '' }
|
191
|
+
undef_method :p
|
192
|
+
undef_method :select
|
167
193
|
|
168
194
|
# Builds a image tag. Assumes <tt>:border => '0', :alt => ''</tt>.
|
169
195
|
def img(opts = {})
|
170
|
-
tag!(:img, @@
|
196
|
+
tag!(:img, @@default[:image_tag_options].merge(opts))
|
171
197
|
end
|
172
198
|
|
173
199
|
# Builds a head tag. Adds a <tt>meta</tt> tag inside with Content-Type
|
174
200
|
# set to <tt>text/html; charset=utf-8</tt>.
|
175
201
|
def head(*args, &block)
|
176
202
|
tag!(:head, *args) do
|
177
|
-
tag!(:meta,
|
203
|
+
tag!(:meta, "http-equiv" => "Content-Type", "content" => "text/html; charset=utf-8") if @output_meta_tag
|
178
204
|
instance_eval &block
|
179
205
|
end
|
180
206
|
end
|
@@ -182,20 +208,18 @@ module Markaby
|
|
182
208
|
# Builds an html tag. An XML 1.0 instruction and an XHTML 1.0 Transitional doctype
|
183
209
|
# are prepended. Also assumes <tt>:xmlns => "http://www.w3.org/1999/xhtml",
|
184
210
|
# "xml:lang" => "en", :lang => "en"</tt>.
|
185
|
-
def html(*
|
186
|
-
if
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
@builder.declare!(:DOCTYPE, :html, :PUBLIC, *args)
|
191
|
-
tag!(:html, :xmlns => "http://www.w3.org/1999/xhtml",
|
192
|
-
"xml:lang" => "en", :lang => "en", &block)
|
211
|
+
def html(*doctype, &block)
|
212
|
+
doctype = XHTMLTransitional if doctype.empty?
|
213
|
+
@builder.instruct! if @output_xml_instruction
|
214
|
+
@builder.declare!(:DOCTYPE, :html, :PUBLIC, *doctype)
|
215
|
+
tag!(:html, :xmlns => "http://www.w3.org/1999/xhtml", "xml:lang" => "en", :lang => "en", &block)
|
193
216
|
end
|
194
217
|
alias_method :xhtml_transitional, :html
|
195
218
|
|
196
219
|
# Builds an html tag with XHTML 1.0 Strict doctype instead.
|
197
220
|
def xhtml_strict(&block)
|
198
|
-
html
|
221
|
+
html XHTMLStrict, &block
|
199
222
|
end
|
223
|
+
|
200
224
|
end
|
201
225
|
end
|
data/lib/markaby/tags.rb
CHANGED
data/test/test_markaby.rb
CHANGED
@@ -1,26 +1,22 @@
|
|
1
1
|
require 'test/unit'
|
2
2
|
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'markaby'))
|
3
3
|
|
4
|
+
module MarkabyTestHelpers
|
5
|
+
def link_to(obj)
|
6
|
+
%{<a href="">#{obj}</a>}
|
7
|
+
end
|
8
|
+
def pluralize(n, string)
|
9
|
+
n == 1 ? string : string + "s"
|
10
|
+
end
|
11
|
+
module_function :link_to, :pluralize
|
12
|
+
end
|
13
|
+
|
4
14
|
class MarkabyTest < Test::Unit::TestCase
|
5
15
|
|
6
16
|
def mab(string, assigns = {}, helpers = nil)
|
7
17
|
Markaby::Template.new(string.to_s).render(assigns, helpers)
|
8
18
|
end
|
9
19
|
|
10
|
-
def setup
|
11
|
-
@helpers = Module.new do
|
12
|
-
def link_to(obj)
|
13
|
-
%{<a href="">#{obj}</a>}
|
14
|
-
end
|
15
|
-
def pluralize(n, string)
|
16
|
-
n == 1 ? string : string + "s"
|
17
|
-
end
|
18
|
-
module_function :link_to, :pluralize
|
19
|
-
end
|
20
|
-
@helpers_ohf = @helpers.dup
|
21
|
-
@helpers_ohf.instance_variable_set("@output_helpers", false)
|
22
|
-
end
|
23
|
-
|
24
20
|
def test_simple
|
25
21
|
assert_equal "<hr/>\n", mab("hr")
|
26
22
|
assert_equal "<p>foo</p>\n", mab("p 'foo'")
|
@@ -36,6 +32,7 @@ class MarkabyTest < Test::Unit::TestCase
|
|
36
32
|
def test_escaping
|
37
33
|
assert_equal "<h1>Apples & Oranges</h1>\n", mab("h1 'Apples & Oranges'")
|
38
34
|
assert_equal "<h1>\nApples & Oranges</h1>\n", mab("h1 { 'Apples & Oranges' }")
|
35
|
+
assert_equal "<h1 class=\"fruits&floots\">Apples</h1>\n", mab("h1 'Apples', :class => 'fruits&floots'")
|
39
36
|
end
|
40
37
|
|
41
38
|
def test_capture
|
@@ -45,9 +42,17 @@ class MarkabyTest < Test::Unit::TestCase
|
|
45
42
|
assert mab("capture { h1 'hello world' }").empty?
|
46
43
|
end
|
47
44
|
|
45
|
+
def test_ivars
|
46
|
+
html = "<div>\n<h1>Steve</h1>\n<div>\n<h2>Gerald</h2>\n</div>\n<h3>Gerald</h3>\n</div>\n"
|
47
|
+
assert_equal html, mab("div { @name = 'Steve'; h1 @name; div { @name = 'Gerald'; h2 @name }; h3 @name }")
|
48
|
+
assert_equal html, mab("div { @name = 'Steve'; h1 @name; self << capture { div { @name = 'Gerald'; h2 @name } }; h3 @name }")
|
49
|
+
assert_equal html, mab("div { h1 @name; self << capture { div { @name = 'Gerald'; h2 @name } }; h3 @name }",
|
50
|
+
:name => 'Steve')
|
51
|
+
end
|
52
|
+
|
48
53
|
def test_output_helpers
|
49
|
-
assert_equal %{<a href="">edit</a>}, mab("link_to('edit')", {},
|
50
|
-
assert mab("link_to('edit')", {},
|
54
|
+
assert_equal %{<a href="">edit</a>}, mab("link_to('edit')", {}, MarkabyTestHelpers)
|
55
|
+
assert mab("@output_helpers = false; link_to('edit')", {}, MarkabyTestHelpers).empty?
|
51
56
|
end
|
52
57
|
|
53
58
|
end
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: markaby
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: "0.
|
7
|
-
date: 2006-
|
6
|
+
version: "0.4"
|
7
|
+
date: 2006-04-11 00:00:00 -06:00
|
8
8
|
summary: Markup as Ruby, write HTML in your native Ruby tongue
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -31,75 +31,16 @@ files:
|
|
31
31
|
- README
|
32
32
|
- Rakefile
|
33
33
|
- setup.rb
|
34
|
-
- doc/rdoc
|
35
|
-
- doc/rdoc/created.rid
|
36
|
-
- doc/rdoc/rdoc-style.css
|
37
|
-
- doc/rdoc/files
|
38
|
-
- doc/rdoc/classes
|
39
|
-
- doc/rdoc/fr_file_index.html
|
40
|
-
- doc/rdoc/fr_class_index.html
|
41
|
-
- doc/rdoc/fr_method_index.html
|
42
|
-
- doc/rdoc/index.html
|
43
|
-
- doc/rdoc/files/README.html
|
44
|
-
- doc/rdoc/files/CHANGELOG.html
|
45
|
-
- doc/rdoc/files/lib
|
46
|
-
- doc/rdoc/files/lib/markaby_rb.html
|
47
|
-
- doc/rdoc/files/lib/markaby
|
48
|
-
- doc/rdoc/files/lib/markaby/metaid_rb.html
|
49
|
-
- doc/rdoc/files/lib/markaby/tags_rb.html
|
50
|
-
- doc/rdoc/files/lib/markaby/builder_rb.html
|
51
|
-
- doc/rdoc/files/lib/markaby/cssproxy_rb.html
|
52
|
-
- doc/rdoc/files/lib/markaby/view_rb.html
|
53
|
-
- doc/rdoc/files/lib/markaby/template_rb.html
|
54
|
-
- doc/rdoc/files/lib/markaby/helper_rb.html
|
55
|
-
- doc/rdoc/classes/Object.src
|
56
|
-
- doc/rdoc/classes/Markaby
|
57
|
-
- doc/rdoc/classes/Object.html
|
58
|
-
- doc/rdoc/classes/Markaby.html
|
59
|
-
- doc/rdoc/classes/Object.src/M000001.html
|
60
|
-
- doc/rdoc/classes/Object.src/M000002.html
|
61
|
-
- doc/rdoc/classes/Object.src/M000003.html
|
62
|
-
- doc/rdoc/classes/Object.src/M000004.html
|
63
|
-
- doc/rdoc/classes/Markaby/ActionControllerHelper.src
|
64
|
-
- doc/rdoc/classes/Markaby/CssProxy.src
|
65
|
-
- doc/rdoc/classes/Markaby/Builder.src
|
66
|
-
- doc/rdoc/classes/Markaby/Template.src
|
67
|
-
- doc/rdoc/classes/Markaby/View.src
|
68
|
-
- doc/rdoc/classes/Markaby/ActionControllerHelper.html
|
69
|
-
- doc/rdoc/classes/Markaby/CssProxy.html
|
70
|
-
- doc/rdoc/classes/Markaby/Builder.html
|
71
|
-
- doc/rdoc/classes/Markaby/Template.html
|
72
|
-
- doc/rdoc/classes/Markaby/View.html
|
73
|
-
- doc/rdoc/classes/Markaby/ActionControllerHelper.src/M000005.html
|
74
|
-
- doc/rdoc/classes/Markaby/CssProxy.src/M000006.html
|
75
|
-
- doc/rdoc/classes/Markaby/CssProxy.src/M000007.html
|
76
|
-
- doc/rdoc/classes/Markaby/Builder.src/M000008.html
|
77
|
-
- doc/rdoc/classes/Markaby/Builder.src/M000009.html
|
78
|
-
- doc/rdoc/classes/Markaby/Builder.src/M000010.html
|
79
|
-
- doc/rdoc/classes/Markaby/Builder.src/M000012.html
|
80
|
-
- doc/rdoc/classes/Markaby/Builder.src/M000013.html
|
81
|
-
- doc/rdoc/classes/Markaby/Builder.src/M000014.html
|
82
|
-
- doc/rdoc/classes/Markaby/Builder.src/M000015.html
|
83
|
-
- doc/rdoc/classes/Markaby/Builder.src/M000016.html
|
84
|
-
- doc/rdoc/classes/Markaby/Builder.src/M000017.html
|
85
|
-
- doc/rdoc/classes/Markaby/Builder.src/M000018.html
|
86
|
-
- doc/rdoc/classes/Markaby/Builder.src/M000019.html
|
87
|
-
- doc/rdoc/classes/Markaby/Builder.src/M000021.html
|
88
|
-
- doc/rdoc/classes/Markaby/Template.src/M000022.html
|
89
|
-
- doc/rdoc/classes/Markaby/Template.src/M000023.html
|
90
|
-
- doc/rdoc/classes/Markaby/View.src/M000024.html
|
91
|
-
- doc/rdoc/classes/Markaby/View.src/M000025.html
|
92
34
|
- test/test_markaby.rb
|
93
|
-
- test/example.rb
|
94
35
|
- lib/markaby
|
95
36
|
- lib/markaby.rb
|
96
|
-
- lib/markaby/
|
37
|
+
- lib/markaby/helper.rb
|
97
38
|
- lib/markaby/tags.rb
|
39
|
+
- lib/markaby/metaid.rb
|
98
40
|
- lib/markaby/builder.rb
|
99
41
|
- lib/markaby/cssproxy.rb
|
100
42
|
- lib/markaby/view.rb
|
101
43
|
- lib/markaby/template.rb
|
102
|
-
- lib/markaby/helper.rb
|
103
44
|
- tools/rakehelp.rb
|
104
45
|
test_files:
|
105
46
|
- test/test_markaby.rb
|
@@ -1,192 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Module: Markaby</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Module</strong></td>
|
53
|
-
<td class="class-name-in-header">Markaby</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../files/lib/markaby_rb.html">
|
59
|
-
lib/markaby.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
<a href="../files/lib/markaby/tags_rb.html">
|
63
|
-
lib/markaby/tags.rb
|
64
|
-
</a>
|
65
|
-
<br />
|
66
|
-
<a href="../files/lib/markaby/builder_rb.html">
|
67
|
-
lib/markaby/builder.rb
|
68
|
-
</a>
|
69
|
-
<br />
|
70
|
-
<a href="../files/lib/markaby/cssproxy_rb.html">
|
71
|
-
lib/markaby/cssproxy.rb
|
72
|
-
</a>
|
73
|
-
<br />
|
74
|
-
<a href="../files/lib/markaby/view_rb.html">
|
75
|
-
lib/markaby/view.rb
|
76
|
-
</a>
|
77
|
-
<br />
|
78
|
-
<a href="../files/lib/markaby/template_rb.html">
|
79
|
-
lib/markaby/template.rb
|
80
|
-
</a>
|
81
|
-
<br />
|
82
|
-
<a href="../files/lib/markaby/helper_rb.html">
|
83
|
-
lib/markaby/helper.rb
|
84
|
-
</a>
|
85
|
-
<br />
|
86
|
-
</td>
|
87
|
-
</tr>
|
88
|
-
|
89
|
-
</table>
|
90
|
-
</div>
|
91
|
-
<!-- banner header -->
|
92
|
-
|
93
|
-
<div id="bodyContent">
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
<div id="contextContent">
|
98
|
-
|
99
|
-
<div id="description">
|
100
|
-
<p>
|
101
|
-
<a href="Markaby.html">Markaby</a> is a module containing all of the great
|
102
|
-
<a href="Markaby.html">Markaby</a> classes that do such an excellent job.
|
103
|
-
</p>
|
104
|
-
<ul>
|
105
|
-
<li><a href="Markaby/Builder.html">Markaby::Builder</a>: the class for actually
|
106
|
-
calling the Ruby methods which write the HTML.
|
107
|
-
|
108
|
-
</li>
|
109
|
-
<li>Markaby::CSSProxy: a class which adds element classes and IDs to elements
|
110
|
-
when used within <a href="Markaby/Builder.html">Markaby::Builder</a>.
|
111
|
-
|
112
|
-
</li>
|
113
|
-
<li>Markaby::MetAid: metaprogramming helper methods.
|
114
|
-
|
115
|
-
</li>
|
116
|
-
<li>Markaby::Tags: lists the roles of various XHTML tags to help <a
|
117
|
-
href="Markaby/Builder.html">Builder</a> use these tags as they are
|
118
|
-
intended.
|
119
|
-
|
120
|
-
</li>
|
121
|
-
<li><a href="Markaby/Template.html">Markaby::Template</a>: a class for hooking
|
122
|
-
<a href="Markaby.html">Markaby</a> into Rails as a proper templating
|
123
|
-
language.
|
124
|
-
|
125
|
-
</li>
|
126
|
-
</ul>
|
127
|
-
|
128
|
-
</div>
|
129
|
-
|
130
|
-
|
131
|
-
</div>
|
132
|
-
|
133
|
-
|
134
|
-
</div>
|
135
|
-
|
136
|
-
|
137
|
-
<!-- if includes -->
|
138
|
-
|
139
|
-
<div id="section">
|
140
|
-
|
141
|
-
<div id="class-list">
|
142
|
-
<h3 class="section-bar">Classes and Modules</h3>
|
143
|
-
|
144
|
-
Module <a href="Markaby/ActionControllerHelper.html" class="link">Markaby::ActionControllerHelper</a><br />
|
145
|
-
Class <a href="Markaby/Builder.html" class="link">Markaby::Builder</a><br />
|
146
|
-
Class <a href="Markaby/CssProxy.html" class="link">Markaby::CssProxy</a><br />
|
147
|
-
Class <a href="Markaby/Template.html" class="link">Markaby::Template</a><br />
|
148
|
-
Class <a href="Markaby/View.html" class="link">Markaby::View</a><br />
|
149
|
-
|
150
|
-
</div>
|
151
|
-
|
152
|
-
<div id="constants-list">
|
153
|
-
<h3 class="section-bar">Constants</h3>
|
154
|
-
|
155
|
-
<div class="name-list">
|
156
|
-
<table summary="Constants">
|
157
|
-
<tr class="top-aligned-row context-row">
|
158
|
-
<td class="context-item-name">VERSION</td>
|
159
|
-
<td>=</td>
|
160
|
-
<td class="context-item-value">'0.3'</td>
|
161
|
-
</tr>
|
162
|
-
<tr class="top-aligned-row context-row">
|
163
|
-
<td class="context-item-name">TAGS</td>
|
164
|
-
<td>=</td>
|
165
|
-
<td class="context-item-value">[ :a, :abbr, :acronym, :span, :b, :caption, :del, :cite, :code, :col, :colgroup, :dd, :dfn, :dt, :em, :fieldset, :i, :img, :ins, :kbd, :p, :label, :legend, :li, :optgroup, :option, :select, :small, :span, :strong, :sub, :sup, :tbody, :td, :textarea, :thead, :title, :th, :tr, :tfoot, :tt, :address, :blockquote, :body, :div, :dl, :form, :h1, :h2, :h3, :head, :noscript, :object, :ol, :pre, :q, :samp, :script, :style, :table, :ul</td>
|
166
|
-
</tr>
|
167
|
-
<tr class="top-aligned-row context-row">
|
168
|
-
<td class="context-item-name">SELF_CLOSING_TAGS</td>
|
169
|
-
<td>=</td>
|
170
|
-
<td class="context-item-value">[ :hr, :br, :link, :meta, :input ]</td>
|
171
|
-
</tr>
|
172
|
-
</table>
|
173
|
-
</div>
|
174
|
-
</div>
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
<!-- if method_list -->
|
182
|
-
|
183
|
-
|
184
|
-
</div>
|
185
|
-
|
186
|
-
|
187
|
-
<div id="validator-badges">
|
188
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
189
|
-
</div>
|
190
|
-
|
191
|
-
</body>
|
192
|
-
</html>
|