masterview 0.2.5 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +31 -1
- data/README +70 -69
- data/RELEASE_NOTES +70 -64
- data/Rakefile +26 -27
- data/TODO +13 -29
- data/doc/about.html +246 -0
- data/doc/configuration.html +49 -36
- data/doc/developer.html +423 -41
- data/doc/directives.html +139 -51
- data/doc/guide.html +19 -9
- data/doc/index.html +90 -224
- data/doc/installation.html +36 -28
- data/doc/media_list.html +30 -20
- data/doc/simple_diagram.html +3 -5
- data/doc/stylesheets/masterview.css +16 -1
- data/examples/rails_app_config/masterview/settings.rb +2 -1
- data/init.rb +1 -1
- data/lib/#ChangeLog# +6 -0
- data/lib/masterview/analyzer.rb +48 -34
- data/lib/masterview/attr_string_parser.rb +5 -1
- data/lib/masterview/case_insensitive_hash.rb +69 -0
- data/lib/masterview/{pathname_extensions.rb → core_ext/pathname.rb} +0 -0
- data/lib/masterview/{string_extensions.rb → core_ext/string.rb} +0 -0
- data/lib/masterview/deprecated/directive_base.rb +362 -0
- data/lib/masterview/directive_base.rb +201 -179
- data/lib/masterview/directive_dsl.rb +457 -0
- data/lib/masterview/directive_helpers.rb +28 -141
- data/lib/masterview/directive_load_path.rb +388 -0
- data/lib/masterview/directive_metadata.rb +377 -0
- data/lib/masterview/directive_registry.rb +259 -69
- data/lib/masterview/directives/.metadata +16 -0
- data/lib/masterview/directives/attr.rb +9 -8
- data/lib/masterview/directives/block.rb +11 -14
- data/lib/masterview/directives/check_box.rb +13 -18
- data/lib/masterview/directives/collection_select.rb +15 -29
- data/lib/masterview/directives/content.rb +9 -3
- data/lib/masterview/directives/else.rb +15 -13
- data/lib/masterview/directives/elsif.rb +14 -13
- data/lib/masterview/directives/eval.rb +20 -0
- data/lib/masterview/directives/form.rb +56 -9
- data/lib/masterview/directives/form_remote.rb +26 -0
- data/lib/masterview/directives/global_inline_erb.rb +10 -14
- data/lib/masterview/directives/hidden_field.rb +11 -20
- data/lib/masterview/directives/if.rb +13 -12
- data/lib/masterview/directives/image_tag.rb +20 -28
- data/lib/masterview/directives/import.rb +5 -12
- data/lib/masterview/directives/import_render.rb +7 -19
- data/lib/masterview/directives/insert_generated_comment.rb +8 -11
- data/lib/masterview/directives/javascript_include.rb +21 -12
- data/lib/masterview/directives/link_to.rb +14 -8
- data/lib/masterview/directives/link_to_function.rb +22 -0
- data/lib/masterview/directives/link_to_if.rb +15 -13
- data/lib/masterview/directives/link_to_remote.rb +13 -8
- data/lib/masterview/directives/omit_tag.rb +32 -16
- data/lib/masterview/directives/password_field.rb +10 -22
- data/lib/masterview/directives/radio_button.rb +11 -22
- data/lib/masterview/directives/replace.rb +7 -8
- data/lib/masterview/directives/select.rb +11 -24
- data/lib/masterview/directives/stylesheet_link.rb +20 -12
- data/lib/masterview/directives/submit.rb +11 -5
- data/lib/masterview/directives/text_area.rb +10 -23
- data/lib/masterview/directives/text_field.rb +10 -22
- data/lib/masterview/exceptions.rb +21 -0
- data/lib/masterview/extras/app/controllers/masterview_controller.rb +102 -75
- data/lib/masterview/extras/app/views/layouts/masterview_admin.rhtml +24 -23
- data/lib/masterview/extras/app/views/layouts/masterview_admin_config.rhtml +81 -0
- data/lib/masterview/extras/app/views/masterview/admin/configuration.rhtml +5 -1
- data/lib/masterview/extras/app/views/masterview/admin/create.rhtml +2 -2
- data/lib/masterview/extras/app/views/masterview/admin/directives.rhtml +5 -0
- data/lib/masterview/extras/app/views/masterview/admin/features.rhtml +5 -79
- data/lib/masterview/extras/app/views/masterview/admin/interact.rhtml +5 -0
- data/lib/masterview/extras/app/views/masterview/admin/list.rhtml +3 -71
- data/lib/masterview/extras/init_mv_admin_pages.rb +42 -23
- data/lib/masterview/filter_helpers.rb +26 -0
- data/lib/masterview/initializer.rb +99 -53
- data/lib/masterview/io.rb +19 -15
- data/lib/masterview/keyword_expander.rb +7 -2
- data/lib/masterview/masterview_info.rb +229 -23
- data/lib/masterview/masterview_version.rb +2 -2
- data/lib/masterview/parser.rb +275 -105
- data/lib/masterview/parser_helpers.rb +54 -0
- data/lib/masterview/rails_ext/action_controller_erb_direct.rb +29 -0
- data/lib/masterview/rails_ext/action_controller_reparse_checking.rb +27 -0
- data/lib/masterview/{extras/init_rails_erb_mv_direct.rb → rails_ext/action_view_erb_direct.rb} +12 -59
- data/lib/masterview/template_spec.rb +3 -2
- data/lib/masterview.rb +21 -12
- data/lib/rexml/parsers/baseparser_with_doctype_fix.rb +473 -0
- data/lib/rexml/parsers/sax2parser_with_doctype_fix.rb +243 -0
- data/test/directive_test_helper.rb +135 -0
- data/test/fixtures/directives/id_check.rb +18 -0
- data/test/fixtures/directives/test_directive_events.rb +70 -0
- data/test/test_helper.rb +18 -5
- data/test/tmp/views/layouts/product.rhtml +10 -10
- data/test/tmp/views/product/_form.rhtml +4 -4
- data/test/tmp/views/product/_product.rhtml +3 -3
- data/test/tmp/views/product/destroy.rhtml +5 -5
- data/test/tmp/views/product/edit.rhtml +4 -4
- data/test/tmp/views/product/list.rhtml +3 -3
- data/test/tmp/views/product/new.rhtml +4 -4
- data/test/tmp/views/product/show.rhtml +2 -2
- data/test/unit/attr_string_parser_test.rb +105 -0
- data/test/unit/case_insensitive_hash_mod_test.rb +104 -0
- data/test/unit/config_settings_test.rb +13 -1
- data/test/unit/default_generate_mio_filter_test.rb +3 -3
- data/test/unit/deprecated_directive_base_test.rb +30 -0
- data/test/unit/directive_attr_test.rb +111 -35
- data/test/unit/directive_base_test.rb +520 -1
- data/test/unit/directive_block_test.rb +30 -22
- data/test/unit/directive_content_test.rb +24 -11
- data/test/unit/directive_else_test.rb +18 -15
- data/test/unit/directive_elsif_test.rb +17 -15
- data/test/unit/directive_form_remote_test.rb +59 -0
- data/test/unit/directive_form_test.rb +31 -39
- data/test/unit/directive_global_inline_erb_test.rb +28 -17
- data/test/unit/directive_grid_test_notready.rb +38 -0
- data/test/unit/directive_helpers_test.rb +39 -0
- data/test/unit/directive_hidden_field_test.rb +44 -29
- data/test/unit/directive_if_test.rb +10 -7
- data/test/unit/directive_image_tag_test.rb +69 -61
- data/test/unit/directive_import_render_test.rb +28 -38
- data/test/unit/directive_import_test.rb +16 -14
- data/test/unit/directive_insert_generated_comment_test.rb +32 -0
- data/test/unit/directive_javascript_include_test.rb +40 -43
- data/test/unit/directive_link_to_function_test.rb +40 -0
- data/test/unit/directive_link_to_if_test.rb +52 -12
- data/test/unit/directive_link_to_remote_test.rb +58 -0
- data/test/unit/directive_link_to_test.rb +46 -31
- data/test/unit/directive_load_path_test.rb +257 -0
- data/test/unit/directive_metadata_test.rb +313 -0
- data/test/unit/directive_omit_tag_test.rb +73 -21
- data/test/unit/directive_password_field_test.rb +44 -38
- data/test/unit/directive_registry_test.rb +44 -0
- data/test/unit/directive_replace_test.rb +28 -12
- data/test/unit/directive_stylesheet_link_test.rb +43 -36
- data/test/unit/directive_submit_test.rb +29 -30
- data/test/unit/directive_text_area_test.rb +40 -36
- data/test/unit/directive_text_field_test.rb +44 -38
- data/test/unit/example_directive_child_events_test.rb +41 -0
- data/test/unit/example_test.rb +31 -4
- data/test/unit/file_mio_test.rb +18 -13
- data/test/unit/filter_helpers_test.rb +10 -8
- data/test/unit/find_directive_parent_test.rb +174 -0
- data/test/unit/keyword_expander_test.rb +4 -2
- data/test/unit/mio_test.rb +18 -11
- data/test/unit/mtime_string_hash_mio_tree_test.rb +5 -1
- data/test/unit/parser_test.rb +41 -29
- data/test/unit/pathname_extensions_test.rb +1 -1
- data/test/unit/run_parser_test.rb +2 -2
- data/test/unit/simplified_directive_base_test.rb +256 -0
- data/test/unit/string_hash_mio_test.rb +5 -1
- data/test/unit/template_file_watcher_test.rb +2 -2
- data/test/unit/template_test.rb +221 -46
- metadata +86 -45
- data/lib/masterview/directives/testfilter.rb +0 -55
- data/lib/masterview/extras/init_rails_reparse_checking.rb +0 -62
data/doc/index.html
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
2
|
+
<!DOCTYPE html
|
3
3
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
4
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
5
|
|
6
6
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
7
|
<head>
|
8
8
|
|
9
|
-
<title>MasterView - Rails-optimized (x)html friendly template engine</title>
|
9
|
+
<title>MasterView™ - Rails-optimized (x)html friendly template engine</title>
|
10
10
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
11
11
|
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
12
12
|
|
@@ -25,6 +25,8 @@
|
|
25
25
|
·
|
26
26
|
<a href="./index.html">Doc Home</a>
|
27
27
|
|
|
28
|
+
<a href="./about.html">About</a>
|
29
|
+
|
|
28
30
|
<a href="./installation.html">Installation</a>
|
29
31
|
|
|
30
32
|
<a href="./configuration.html">Configuration</a>
|
@@ -32,8 +34,10 @@
|
|
32
34
|
<a href="./guide.html">Usage</a>
|
33
35
|
|
|
34
36
|
<a href="./directives.html">Directives</a>
|
35
|
-
 
|
36
|
-
<a href="./
|
37
|
+
|
|
38
|
+
<a href="./developer.html">Developers</a>
|
39
|
+
|
|
40
|
+
<a href="./media_list.html">Screencasts</a>
|
37
41
|
·
|
38
42
|
</div>
|
39
43
|
</div>
|
@@ -41,35 +45,35 @@
|
|
41
45
|
<div id="pageBody">
|
42
46
|
<div id="bodyContent">
|
43
47
|
|
44
|
-
<h1>MasterView - Rails-optimized (x)html friendly template engine</h1>
|
48
|
+
<h1>MasterView™ - Rails-optimized (x)html friendly template engine</h1>
|
45
49
|
|
46
50
|
<p>
|
47
|
-
MasterView is a ruby/rails
|
51
|
+
MasterView™ is a ruby/rails
|
48
52
|
optimized HTML/XHTML friendly template engine. It is designed to use the
|
49
53
|
<b>full power and productivity of rails including layouts, partials, and rails
|
50
54
|
html helpers</b> while still being editable/styleable in a <b>WYSIWYG</b> HTML editor.
|
51
55
|
</p>
|
52
|
-
<p>
|
53
|
-
MasterView is distributed as a gem
|
54
|
-
or a plugin. You may install it as a gem and then generate a lightweight
|
55
|
-
plugin which mainly refers to the gem <b>or</b> you can simply install as a
|
56
|
-
plugin which is self contained. I personally prefer installing as a gem for
|
57
|
-
ease of management, however if you are running at a shared hosting
|
58
|
-
environment you might not have authority to install this gem so you may
|
59
|
-
install as a self contained plugin.
|
60
|
-
</p>
|
61
|
-
<p>
|
62
|
-
If you are interested in the background story behind all this, it is at the
|
63
|
-
end of this page.
|
64
|
-
</p>
|
65
56
|
|
66
57
|
<p>
|
67
58
|
<table summary="project location and author information">
|
68
59
|
<tr>
|
69
60
|
<td>Author:</td>
|
70
|
-
<td>Jeff Barczewski (jeff.barczewski <span class="class">
|
61
|
+
<td style="padding-right: 10px;">Jeff Barczewski (jeff.barczewski <span class="class"> (at) </span> gmail (dot) com)</td>
|
62
|
+
<td colspan="2"> </td>
|
63
|
+
</tr>
|
64
|
+
<tr>
|
65
|
+
<td>Primary developers:</td><td>Jeff Barczewski, Deb Lewis</td>
|
66
|
+
<td colspan="2"> </td>
|
67
|
+
<tr>
|
68
|
+
<td>License:</td>
|
69
|
+
<td>MIT open source license (like Rails)</td>
|
70
|
+
<td rowspan="4">Mailing lists:</td>
|
71
|
+
<td rowspan="4">Join mailing lists at <a href="http://rubyforge.org/mail/?group_id=1290">rubyforge.org</a>
|
72
|
+
<div style="margin-left: 10px;"><code>masterview-announce</code> - MasterView release announcements</div>
|
73
|
+
<div style="margin-left: 10px;"><code>masterview-users</code> - Discussion, problems, ideas, suggestions for MasterView</div>
|
74
|
+
<div style="margin-left: 10px;"><code>masterview-devel</code> - MasterView project developer list</div>
|
75
|
+
</td>
|
71
76
|
</tr>
|
72
|
-
<tr><td>Primary developers:</td><td>Jeff Barczewski, Deb Lewis</td></tr>
|
73
77
|
<tr>
|
74
78
|
<td>Website:</td>
|
75
79
|
<td><a href="http://masterview.org">masterview.org</a></td>
|
@@ -78,47 +82,28 @@ end of this page.
|
|
78
82
|
<td>Rubyforge project:</td>
|
79
83
|
<td><a href="http://rubyforge.org/projects/masterview/">masterview</a></td>
|
80
84
|
</tr>
|
81
|
-
<tr><td
|
82
|
-
</td></tr>
|
83
|
-
<tr>
|
84
|
-
<td>Mailing lists:</td>
|
85
|
-
<td>Join mailing lists at <a href="http://rubyforge.org/mail/?group_id=1290">rubyforge.org</a></td>
|
86
|
-
</tr>
|
87
|
-
<tr>
|
88
|
-
<td> </td>
|
89
|
-
<td>masterview-announce - MasterView release announcements</td>
|
90
|
-
</tr>
|
91
|
-
<tr>
|
92
|
-
<td> </td>
|
93
|
-
<td>masterview-users - Discussion, problems, ideas, suggestions for MasterView</td>
|
94
|
-
</tr>
|
95
|
-
<tr>
|
96
|
-
<td> </td>
|
97
|
-
<td>masterview-devel - MasterView project developer list</td>
|
98
|
-
</tr>
|
85
|
+
<tr><td colspan="2"> </td></tr>
|
99
86
|
</table>
|
100
|
-
</p>
|
101
87
|
|
102
|
-
<
|
103
|
-
<
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
<
|
108
|
-
|
109
|
-
</li>
|
110
|
-
</ul>
|
88
|
+
<hr />
|
89
|
+
<p>Why invent another templating engine?
|
90
|
+
In short, to be able to use standard web design tools such as WYSIWYG editors to design and lay out pages for a rails site, without giving up the power and productivity of layouts, partials, and rails helpers.
|
91
|
+
As programmers, we want to be able to create rails view templates which can also be worked on by web designers with their own tools for complex graphics and styling.
|
92
|
+
If you are interested in the background story and the goals of the MasterView project,
|
93
|
+
visit the <a href="about.html">About</a> page to learn more.
|
94
|
+
</p>
|
111
95
|
|
112
|
-
<h2>
|
113
|
-
<ul>
|
114
|
-
<li><a href="http://masterview.org/videos/demo_short.html">MasterView Short Video</a> - demonstrating basic usage of MasterView (no audio, ~5 minutes, uses flash)<br/><br/>
|
115
|
-
<a href="http://masterview.org/videos/demo_short.html"><img src="screenshots/generated_list_thumbnail.png"/></a><br/><br/>
|
96
|
+
<h2>Quick Start and Roadmap</h2>
|
116
97
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
</
|
121
|
-
|
98
|
+
<p>
|
99
|
+
MasterView is distributed as a gem
|
100
|
+
or a plugin. You may install it as a gem and then generate a lightweight
|
101
|
+
plugin which mainly refers to the gem <b>or</b> you can simply install as a
|
102
|
+
plugin which is self contained. I personally prefer installing as a gem for
|
103
|
+
ease of management, however if you are running at a shared hosting
|
104
|
+
environment you might not have authority to install this gem so you may
|
105
|
+
install as a self contained plugin.
|
106
|
+
</p>
|
122
107
|
|
123
108
|
<h2>Usage Scenarios</h2>
|
124
109
|
<ul>
|
@@ -127,70 +112,67 @@ end of this page.
|
|
127
112
|
<li><b>Hybrid of legacy and new</b> - MasterView will coexist nicely with existing rhtml being able to utilize it in new templates or even bring the rhtml into a MasterView template to drive it from there. Build your new MasterView templates with the generator or by augmenting html prototypes.</li>
|
128
113
|
</ul>
|
129
114
|
|
130
|
-
<
|
131
|
-
|
115
|
+
<p>See the <a href="guide.html">MasterView User's Guide</a> for information on using MasterView templates and supporting services.
|
116
|
+
View the <a href="simple_diagram.html">MasterView rendering illustration</a> to understand how a MasterView template renders rhtml
|
132
117
|
</p>
|
133
118
|
|
134
|
-
<
|
135
|
-
<ul>
|
136
|
-
<li>Create/extend a template engine for rails that would be XHTML friendly and
|
137
|
-
thus could be edited/styled with a WYSIWYG HTML editor even late in
|
138
|
-
development without breaking template.
|
139
|
-
|
140
|
-
</li>
|
141
|
-
<li>Keep it simple. DRY. No extra config files, simple syntax with ruby flavor.
|
142
|
-
|
143
|
-
</li>
|
144
|
-
<li>Design it specifically for ruby and rails. Use the full power and not be
|
145
|
-
limited in its capabilities over what can be done with ERb
|
146
|
-
|
147
|
-
</li>
|
148
|
-
<li>Utilize layouts, partials, and rails html helpers.
|
119
|
+
<p>See the <a href="directives.html">MasterView Directives Reference</a> for complete descriptions of all the standard built-in MasterView directives.</p>
|
149
120
|
|
150
|
-
</
|
151
|
-
<li>Reduce complexity, work with existing rails code, no extra view logic or
|
152
|
-
hashes than what is used by ERb. Scaffold generate initial templates or
|
153
|
-
work from existing html prototype.
|
121
|
+
<h2>Diagrams, Screenshots, and Videos</h2>
|
154
122
|
|
155
|
-
</
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
it will be simple to reorder or remove things from views there by eliminating much
|
160
|
-
of the re-work necessary to build out real-world views.
|
123
|
+
<p>The <a href="media_list.html">Screencasts</a> section includes a variety of
|
124
|
+
diagrams, illustrations, screencasts, and other media which provide an introduction
|
125
|
+
and overview of MasterView.
|
126
|
+
</p>
|
161
127
|
|
128
|
+
<table summary="layout area for screencasts info">
|
129
|
+
<tbody>
|
130
|
+
<tr>
|
131
|
+
<td>
|
132
|
+
<h3>Illustrations/Diagrams</h3>
|
133
|
+
<ul>
|
134
|
+
<li><a href="simple_diagram.html">MasterView rendering illustration</a> - showing how MasterView renders rhtml internally<br/><br/>
|
135
|
+
<a href="simple_diagram.html"><img src="images/masterview_rhtml_rendering_thumbnail_smaller.png" title="MasterView rhtml Rendering Illustration" alt="MasterView rhtml Rendering Illustration" /></a><br/><br/>
|
162
136
|
</li>
|
163
|
-
|
164
|
-
|
165
|
-
|
137
|
+
</ul>
|
138
|
+
<h3>Screenshots</h3>
|
139
|
+
<ul>
|
140
|
+
<li><a href="media_list.html">MasterView screenshots</a> - showing some generated MasterView templates and MasterView Admin page<br/><br/>
|
141
|
+
<a href="media_list.html"><img src="screenshots/generated_new_thumbnail.png" title="MasterView Screenshots and other media" alt="MasterView Screenshots and other media" /></a><br/><br/>
|
166
142
|
</li>
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
143
|
+
</ul>
|
144
|
+
</td>
|
145
|
+
<td>
|
146
|
+
<h3>Videos</h3>
|
147
|
+
<ul>
|
148
|
+
<li><a href="http://masterview.org/videos/demo_short.html">MasterView Short Video</a> - demonstrating basic usage of MasterView (no audio, ~5 minutes, uses flash)<br/><br/>
|
149
|
+
<a href="http://masterview.org/videos/demo_short.html"><img src="screenshots/generated_list_thumbnail.png" title="MasterView short video" alt="MasterView short video" /></a><br/><br/>
|
171
150
|
</li>
|
172
|
-
<li>
|
173
|
-
|
151
|
+
<li><a href="http://masterview.org/videos/masterview_quick_start.html">MasterView Quick Start Video</a> - longer video detailing basic configuration and operation of MasterView (no audio, ~25 minutes, uses flash)<br/><br/>
|
152
|
+
<a href="http://masterview.org/videos/masterview_quick_start.html"><img src="screenshots/masterview_admin_thumbnail.png" title="MasterView quick-start video" alt="MasterView quick-start video" /></a><br/><br/>
|
174
153
|
</li>
|
175
154
|
</ul>
|
155
|
+
</td>
|
156
|
+
</tr>
|
157
|
+
</tbody>
|
158
|
+
</table>
|
159
|
+
|
176
160
|
|
177
161
|
|
178
162
|
<h2>Prerequisites</h2>
|
179
163
|
<table summary="prerequisites summary">
|
180
164
|
<tr><td valign="top">Requires:</td><td>No external dependencies
|
181
|
-
|
182
165
|
</td></tr>
|
183
166
|
<tr><td valign="top">Optional:</td><td>tidy, log4r</td></tr>
|
184
167
|
</table>
|
185
168
|
|
186
169
|
<p>See the <a href="installation.html">MasterView Installation Guide</a> for details.</p>
|
187
170
|
|
188
|
-
|
189
171
|
<h2>Installation and Configuration</h2>
|
190
172
|
|
191
173
|
<p>See the <a href="installation.html">MasterView Installation Guide</a> for complete installation instructions.</p>
|
192
174
|
|
193
|
-
<p>Briefly installation/launching is as follows
|
175
|
+
<p>Briefly installation/launching is as follows:</p>
|
194
176
|
<pre style="background-color: #eeeeee">
|
195
177
|
> gem install masterview_gem_pack
|
196
178
|
> rails demo; cd demo
|
@@ -198,131 +180,9 @@ application.
|
|
198
180
|
> script/generate masterview YOURMODEL YOURCONTROLLERNAME
|
199
181
|
> script/server
|
200
182
|
</pre>
|
201
|
-
</p>
|
202
|
-
|
203
|
-
<p>See the <a href="configuration.html">MasterView Configuration Guide</a> for informatino about customizing the MasterView configuration settings for your application.</p>
|
204
183
|
|
205
|
-
<h2>Usage</h2>
|
206
184
|
|
207
|
-
<p>See the <a href="
|
208
|
-
View the <a href="simple_diagram.html" alt="MasterView rhtml rendering illustration">MasterView rendering illustration</a> to understand how a MasterView template renders rhtml
|
209
|
-
</p>
|
210
|
-
|
211
|
-
|
212
|
-
<h2>MasterView attribute directive syntax</h2>
|
213
|
-
|
214
|
-
<p>See the <a href="directives.html">MasterView Directives Reference</a> for complete descriptions of all the standard built-in MasterView directives.</p>
|
215
|
-
|
216
|
-
|
217
|
-
<h2>Background story</h2>
|
218
|
-
<p>
|
219
|
-
I came from a Java Struts environment when I was introduced to Ruby. I was
|
220
|
-
just in the process of evaluating Tapestry and JSF when I learned about
|
221
|
-
Rails. Ruby and Rails changed my world forever. I had to however drop many
|
222
|
-
of my bad habits aquired from years of Java and C++ work. I had to embrace
|
223
|
-
the new ideas and approach things now with a different mindset. (If you
|
224
|
-
ever have a chance to hear Dave Thomas speak, you will know what I mean. He
|
225
|
-
has a wonderfully entertaining yet enlightening way of illustrating this.)
|
226
|
-
</p>
|
227
|
-
<p>
|
228
|
-
After learning the Ruby and Rails way, (Thank you Matz and DHH for such
|
229
|
-
wonderful gifts to the world) I was amazed at how productive this
|
230
|
-
environment is. Programming was fun once again, and everything you do in
|
231
|
-
Ruby or Rails is easier than any other language or framework I have ever
|
232
|
-
seen. Even taking into account having to learn something new, I was still
|
233
|
-
far more productive than ever before. The only thing that I felt that could
|
234
|
-
be done better, was to have a nice html friendly templating engine so that
|
235
|
-
designers and developers could work collaboratively together on a project.
|
236
|
-
The designers could style and layout the pages with their WYSIWYG HTML
|
237
|
-
editors and developers would have the full power of Ruby and Rails without
|
238
|
-
having to jump through extra hoops to use them. I looked at the available
|
239
|
-
html template engines to see if anything fit with my style. I was
|
240
|
-
disappointed with each of them, mainly because they all made it harder than
|
241
|
-
straight ERb (rhtml) and were not able to use layouts and partials easily.
|
242
|
-
</p>
|
243
|
-
<p>
|
244
|
-
After all the hard work so many people have put into Ruby and Rails, I
|
245
|
-
wanted to see if there was anyway I could contribute as well, maybe
|
246
|
-
extending one of the existing template projects to have the ideal
|
247
|
-
functionality I was striving for. I wanted something to make my own web
|
248
|
-
development even more productive. However after reviewing each of them and
|
249
|
-
even getting into the source code, the closest ones seemed to be Amrita2,
|
250
|
-
Liquid, and Kwartz. Unfortunately it was not going to be easy to add the
|
251
|
-
functionality and usability I desired.
|
252
|
-
</p>
|
253
|
-
<p>
|
254
|
-
During my research I learned that many of the rails gurus were putting down
|
255
|
-
html template engines because they felt that they handicapped the developer
|
256
|
-
severely, namely by not taking advantage of rails layouts, partials, and
|
257
|
-
html helpers. After doing some projects with ERb (rhtml) I realized that
|
258
|
-
they were right. I too did not want to give up any of that power either. I
|
259
|
-
also didn’t want to create a bunch of extra code or config to use the
|
260
|
-
templates (extra view code, or data structures to pass to the templates) as
|
261
|
-
so many of the other engines relied on.
|
262
|
-
</p>
|
263
|
-
<p>
|
264
|
-
I expanded my search outside of Ruby for the best html template technology
|
265
|
-
I could find. After reviewing all the front runners I still didn’t
|
266
|
-
find anything that quite met with my goals for developing with ruby and
|
267
|
-
rails. I also didn’t find any technology that was close enough that I
|
268
|
-
could adapt it. However I did come across features in a variety of systems
|
269
|
-
that inspired me, and helped me shape the ideas that are presented here. A few
|
270
|
-
of those systems were Tapestry, Zope/PHP TAL, Kwartz, Amrita 2, Liquid,
|
271
|
-
and Web Objects.
|
272
|
-
</p>
|
273
|
-
<p>
|
274
|
-
After putting much thought into all the possible options I could not see
|
275
|
-
extending an existing template engine to meet my needs. And since I wanted
|
276
|
-
this engine to have all the power of ruby and rails, it seemed that I would
|
277
|
-
be best served by developing a html template syntax that was a thin layer
|
278
|
-
above ERb. That way it would be intuitive to use (not having to learn yet
|
279
|
-
another syntax) yet very powerful. Once I was able to come up with the
|
280
|
-
desired syntax and approach it became apparent that this would also be
|
281
|
-
fairly straightforward to build.
|
282
|
-
</p>
|
283
|
-
<p>
|
284
|
-
I ran the concept by the guys at the St. Louis Ruby Group <a
|
285
|
-
href="http://stlruby.org">stlruby.org</a> and they were excited about the
|
286
|
-
project. With their help I was able to simply some of the confusing or
|
287
|
-
complicated areas before beginning development. They also sparked some
|
288
|
-
ideas about how to make this infinitely extensible such that developers
|
289
|
-
could easily add their own attribute directives. This would give them the
|
290
|
-
power to create custom extensions that would encapsulate some of their
|
291
|
-
development work. This would serve a couple needs, it would not only make
|
292
|
-
this engine extensible, it would also allow this engine to grow easily
|
293
|
-
being composed of small pluggable attribute directives. Many thanks to the
|
294
|
-
members of this group, I continue to enjoy discussing the power of Ruby and
|
295
|
-
learning from each of them on a monthly basis.
|
296
|
-
</p>
|
297
|
-
<p>
|
298
|
-
While I am on the subject of thanks, I would like to thank my wife and
|
299
|
-
daughter for their support as I took time away from them to work on this
|
300
|
-
project and I want to thank God for bringing the right people into my life
|
301
|
-
just when I needed them and for bringing me on this wonderful journey, I am
|
302
|
-
so very blessed. May I be able to give back some of what has been given to
|
303
|
-
me.
|
304
|
-
</p>
|
305
|
-
<p>
|
306
|
-
And one more mention of tremendous thanks to Deb Lewis, the other core developer on the
|
307
|
-
team, she has spent countless hours reviewing, revising, and improving the codebase,
|
308
|
-
configuration, and documentation. The project wouldn't be half of what it is today
|
309
|
-
without all her help, inspiration, and hard work. I thoroughly enjoy working and
|
310
|
-
debating the finer points of the project with her each step of the way.
|
311
|
-
</p>
|
312
|
-
<p>
|
313
|
-
So that’s the story, I hope that many of you will find MasterView to be a useful tool for
|
314
|
-
your development. I am continuing to refine MasterView by using it daily for
|
315
|
-
Genesis Ministry sites and all my web projects. I know that there is much
|
316
|
-
more work needed in documentation, examples, test cases, additional
|
317
|
-
directives, etc., so I would appreciate any feedback and ideas that you
|
318
|
-
have. Thanks for taking the time to review MasterView!
|
319
|
-
</p>
|
320
|
-
<p>
|
321
|
-
Jeff Barczewski
|
322
|
-
(jeff.barczewski
|
323
|
-
<span class="class"> @ </span>
|
324
|
-
gmail.com)
|
325
|
-
</p>
|
185
|
+
<p>See the <a href="configuration.html">MasterView Configuration Guide</a> for information about customizing the MasterView configuration settings for your application.</p>
|
326
186
|
|
327
187
|
</div> <!-- bodyContent -->
|
328
188
|
</div>
|
@@ -332,6 +192,8 @@ gmail.com)
|
|
332
192
|
·
|
333
193
|
<a href="./index.html">Doc Home</a>
|
334
194
|
|
|
195
|
+
<a href="./about.html">About</a>
|
196
|
+
|
|
335
197
|
<a href="./installation.html">Installation</a>
|
336
198
|
|
|
337
199
|
<a href="./configuration.html">Configuration</a>
|
@@ -339,16 +201,20 @@ gmail.com)
|
|
339
201
|
<a href="./guide.html">Usage</a>
|
340
202
|
|
|
341
203
|
<a href="./directives.html">Directives</a>
|
342
|
-
 
|
343
|
-
<a href="./
|
204
|
+
|
|
205
|
+
<a href="./developer.html">Developers</a>
|
206
|
+
|
|
207
|
+
<a href="./media_list.html">Screencasts</a>
|
344
208
|
·
|
345
209
|
</div>
|
346
210
|
<table summary="layout area">
|
347
211
|
<tbody>
|
348
212
|
<tr>
|
349
|
-
<td class="copyright">© Copyright MasterView 2006
|
213
|
+
<td class="copyright">© Copyright MasterView 2006. MasterView™ is a trademark of the MasterView Project.</td>
|
350
214
|
<td class="validators">
|
351
|
-
<a href="http://validator.w3.org/check/referer"
|
215
|
+
<a href="http://validator.w3.org/check/referer"><img
|
216
|
+
src="http://www.w3.org/Icons/valid-xhtml10" class="w3c_validator"
|
217
|
+
title="Valid XHTML 1.0!" alt="Valid XHTML 1.0!" /></a>
|
352
218
|
</td>
|
353
219
|
</tr>
|
354
220
|
</tbody>
|
data/doc/installation.html
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
2
|
+
<!DOCTYPE html
|
3
3
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
4
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
5
|
|
@@ -25,6 +25,8 @@
|
|
25
25
|
·
|
26
26
|
<a href="./index.html">Doc Home</a>
|
27
27
|
|
|
28
|
+
<a href="./about.html">About</a>
|
29
|
+
|
|
28
30
|
<a href="./installation.html">Installation</a>
|
29
31
|
|
|
30
32
|
<a href="./configuration.html">Configuration</a>
|
@@ -32,8 +34,10 @@
|
|
32
34
|
<a href="./guide.html">Usage</a>
|
33
35
|
|
|
34
36
|
<a href="./directives.html">Directives</a>
|
35
|
-
 
|
36
|
-
<a href="./
|
37
|
+
|
|
38
|
+
<a href="./developer.html">Developers</a>
|
39
|
+
|
|
40
|
+
<a href="./media_list.html">Screencasts</a>
|
37
41
|
·
|
38
42
|
</div>
|
39
43
|
</div>
|
@@ -41,7 +45,7 @@
|
|
41
45
|
<div id="pageBody">
|
42
46
|
<div id="bodyContent">
|
43
47
|
|
44
|
-
<h1>MasterView
|
48
|
+
<h1>MasterView Installation Guide</h1>
|
45
49
|
|
46
50
|
<p>
|
47
51
|
<span class="productName">MasterView</span> is a Ruby/Rails
|
@@ -51,10 +55,10 @@ html helpers while still being editable/styleable in a WYSIWYG HTML editor.
|
|
51
55
|
</p>
|
52
56
|
|
53
57
|
<p>
|
54
|
-
<span class="productName">MasterView</span> is distributed as both
|
55
|
-
a gem and as a fully self-contained plugin.
|
58
|
+
<span class="productName">MasterView</span> is distributed as both
|
59
|
+
a gem and as a fully self-contained plugin.
|
56
60
|
You may install it as a gem and then generate a lightweight
|
57
|
-
plugin in your Rails application which references the gem
|
61
|
+
plugin in your Rails application which references the gem
|
58
62
|
<b>or</b> you can simply install a complete copy as a self-contained plugin
|
59
63
|
in your application.
|
60
64
|
</p>
|
@@ -96,8 +100,8 @@ on Ruby 1.8.4 and Rails 1.1.2 on *nix and Windows.
|
|
96
100
|
<td class="package">tidy</td>
|
97
101
|
<td>
|
98
102
|
If HTML tidy support is installed, you can use tidy to
|
99
|
-
automatically clean up html in your templates into valid xhtml
|
100
|
-
prior to MasterView template parsing.
|
103
|
+
automatically clean up html in your templates into valid xhtml
|
104
|
+
prior to MasterView template parsing.
|
101
105
|
You will need both the tidy processor and the Ruby gem tidy library installed on your system.
|
102
106
|
Visit the <a href="http://tidy.sourceforge.net/" target="_blank">HTML Tidy project on sourceforge</a> to download and install tidy on your system.
|
103
107
|
To install the Ruby gem tidy library:
|
@@ -127,7 +131,7 @@ by using the standard Ruby <code>gem</code> package manager
|
|
127
131
|
to <a href="#install_gem">install the MasterView gem</a>
|
128
132
|
<b>or</b>
|
129
133
|
you can <a href="#install_plugin">install a copy of the MasterView plugin</a> in your application.
|
130
|
-
Masterview releases are published on
|
134
|
+
Masterview releases are published on
|
131
135
|
<a href="http://rubyforge.org/projects/masterview/" target="_blank">rubyforge.org</a>
|
132
136
|
and can be downloaded and installed manually or installed using the standard procedures described here.
|
133
137
|
</p>
|
@@ -179,9 +183,9 @@ cd mynewapp
|
|
179
183
|
rails
|
180
184
|
</pre>
|
181
185
|
|
182
|
-
<p>Now run the <code>masterview_plugin_generator</code> in your Rails application directory
|
186
|
+
<p>Now run the <code>masterview_plugin_generator</code> in your Rails application directory
|
183
187
|
to install <span class="productName">MasterView</span> as a plugin.
|
184
|
-
The plugin generator will create a lightweight plugin for <code>masterview</code>
|
188
|
+
The plugin generator will create a lightweight plugin for <code>masterview</code>
|
185
189
|
in your rails <code>vendor/plugins</code> directory, consisting
|
186
190
|
of an <code>init.rb</code> file which causes the MasterView template
|
187
191
|
engine to be loaded during Rails startup.
|
@@ -193,7 +197,6 @@ engine to be loaded during Rails startup.
|
|
193
197
|
</span>
|
194
198
|
</p>
|
195
199
|
<pre class="code">
|
196
|
-
script/generate masterview_plugin
|
197
200
|
ruby script/generate masterview_plugin
|
198
201
|
</pre>
|
199
202
|
|
@@ -207,13 +210,13 @@ your application's <code>config/masterview</code> directory.
|
|
207
210
|
<p>Congratulations - you are now ready to use MasterView in your application!</p>
|
208
211
|
|
209
212
|
<p>To run <span class="productName">MasterView</span> with the default
|
210
|
-
configuration settings, which are designed to be appropriate for a
|
211
|
-
typical Rails application, simply start creating <code>.html</code>
|
212
|
-
template views containing MasterView <code>mv:</code> attribute markup
|
213
|
-
and run your application.
|
213
|
+
configuration settings, which are designed to be appropriate for a
|
214
|
+
typical Rails application, simply start creating <code>.html</code>
|
215
|
+
template views containing MasterView <code>mv:</code> attribute markup
|
216
|
+
and run your application.
|
214
217
|
</p>
|
215
218
|
|
216
|
-
<p>For information about customizing <span class="productName">MasterView</span>
|
219
|
+
<p>For information about customizing <span class="productName">MasterView</span>
|
217
220
|
configuration settings, see the
|
218
221
|
<a href="configuration.html">MasterView Configuration Guide</a>.
|
219
222
|
</p>
|
@@ -251,7 +254,6 @@ your rails application and run the standard Rails
|
|
251
254
|
</p>
|
252
255
|
|
253
256
|
<pre class="code">
|
254
|
-
script/plugin install svn://rubyforge.org/var/svn/masterview/tags/masterview
|
255
257
|
ruby script/plugin install svn://rubyforge.org/var/svn/masterview/tags/masterview
|
256
258
|
</pre>
|
257
259
|
|
@@ -263,7 +265,7 @@ system into your <code>vendor/plugins/masterview</code> directory.
|
|
263
265
|
you can manually download a copy of the <code>masterview</code>
|
264
266
|
plugin package from
|
265
267
|
<a href="http://rubyforge.org/projects/masterview" target="_blank">rubyforge.org/projects/masterview</a>.
|
266
|
-
<span class="explanation">(Go to the <code>Files</code> tab and
|
268
|
+
<span class="explanation">(Go to the <code>Files</code> tab and
|
267
269
|
select the latest release version <i>D.D.D</i>)</span>
|
268
270
|
Download either <code>masterview_plugin-<i>D.D.D</i>.tgz</code>
|
269
271
|
or <code>masterview_plugin-<i>D.D.D</i>.zip</code>
|
@@ -275,13 +277,13 @@ of your rails application to install the <code>masterview</code> plugin.
|
|
275
277
|
<p>Congratulations - you are now ready to use MasterView in your application!</p>
|
276
278
|
|
277
279
|
<p>To run <span class="productName">MasterView</span> with the default
|
278
|
-
configuration settings, which are designed to be appropriate for a
|
279
|
-
typical Rails application, simply start creating <code>.html</code>
|
280
|
-
template views containing MasterView <code>mv:</code> attribute markup
|
281
|
-
and run your application.
|
280
|
+
configuration settings, which are designed to be appropriate for a
|
281
|
+
typical Rails application, simply start creating <code>.html</code>
|
282
|
+
template views containing MasterView <code>mv:</code> attribute markup
|
283
|
+
and run your application.
|
282
284
|
</p>
|
283
285
|
|
284
|
-
<p>For information about customizing <span class="productName">MasterView</span>
|
286
|
+
<p>For information about customizing <span class="productName">MasterView</span>
|
285
287
|
configuration settings, see the
|
286
288
|
<a href="configuration.html">MasterView Configuration Guide</a>.
|
287
289
|
</p>
|
@@ -368,6 +370,8 @@ releases. They are obsolete and should be ignored.
|
|
368
370
|
·
|
369
371
|
<a href="./index.html">Doc Home</a>
|
370
372
|
|
|
373
|
+
<a href="./about.html">About</a>
|
374
|
+
|
|
371
375
|
<a href="./installation.html">Installation</a>
|
372
376
|
|
|
373
377
|
<a href="./configuration.html">Configuration</a>
|
@@ -375,8 +379,10 @@ releases. They are obsolete and should be ignored.
|
|
375
379
|
<a href="./guide.html">Usage</a>
|
376
380
|
|
|
377
381
|
<a href="./directives.html">Directives</a>
|
378
|
-
 
|
379
|
-
<a href="./
|
382
|
+
|
|
383
|
+
<a href="./developer.html">Developers</a>
|
384
|
+
|
|
385
|
+
<a href="./media_list.html">Screencasts</a>
|
380
386
|
·
|
381
387
|
</div>
|
382
388
|
<table summary="layout area">
|
@@ -384,7 +390,9 @@ releases. They are obsolete and should be ignored.
|
|
384
390
|
<tr>
|
385
391
|
<td class="copyright">© Copyright MasterView 2006</td>
|
386
392
|
<td class="validators">
|
387
|
-
<a href="http://validator.w3.org/check/referer"
|
393
|
+
<a href="http://validator.w3.org/check/referer"><img
|
394
|
+
src="http://www.w3.org/Icons/valid-xhtml10" class="w3c_validator"
|
395
|
+
title="Valid XHTML 1.0!" alt="Valid XHTML 1.0!" /></a>
|
388
396
|
</td>
|
389
397
|
</tr>
|
390
398
|
</tbody>
|