masterview 0.1.5 → 0.2.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.
Files changed (105) hide show
  1. data/CHANGELOG +17 -0
  2. data/README +36 -504
  3. data/RELEASE_NOTES +126 -45
  4. data/Rakefile +215 -86
  5. data/TODO +8 -3
  6. data/doc/configuration.html +485 -0
  7. data/doc/directives.html +1085 -0
  8. data/doc/guide.html +243 -0
  9. data/doc/index.html +287 -0
  10. data/doc/installation.html +376 -0
  11. data/doc/stylesheets/masterview.css +206 -0
  12. data/doc/stylesheets/mv-config.css +23 -0
  13. data/doc/stylesheets/mv-directives.css +18 -0
  14. data/doc/stylesheets/mv-installation.css +10 -0
  15. data/doc/troubleshooting.html +18 -0
  16. data/examples/product.html +256 -0
  17. data/examples/product.html.old +107 -0
  18. data/examples/rails_app_config/masterview/environment/development.rb +22 -0
  19. data/examples/rails_app_config/masterview/environment/production.rb +9 -0
  20. data/examples/rails_app_config/masterview/settings.rb +59 -0
  21. data/examples/test.import +80 -0
  22. data/init.rb +26 -12
  23. data/lib/masterview/analyzer.rb +25 -15
  24. data/lib/masterview/directive_base.rb +4 -0
  25. data/lib/masterview/directive_helpers.rb +7 -5
  26. data/lib/masterview/directives/import_render.rb +6 -0
  27. data/lib/masterview/directives/insert_generated_comment.rb +8 -8
  28. data/lib/masterview/extras/app/controllers/masterview_controller.rb +154 -2
  29. data/lib/masterview/extras/app/views/masterview/admin/create.rhtml +4 -4
  30. data/lib/masterview/extras/app/views/masterview/admin/empty.rhtml +1 -1
  31. data/lib/masterview/extras/app/views/masterview/admin/list.rhtml +14 -9
  32. data/lib/masterview/extras/app/views/masterview/admin/view_rhtml.rhtml +70 -0
  33. data/lib/masterview/extras/init_logger.rb +102 -0
  34. data/lib/masterview/extras/init_rails_erb_mv_direct.rb +117 -0
  35. data/lib/masterview/extras/init_rails_reparse_checking.rb +59 -0
  36. data/lib/masterview/extras/watcher.rb +17 -23
  37. data/lib/masterview/filter_helpers.rb +26 -0
  38. data/lib/masterview/initializer.rb +912 -0
  39. data/lib/masterview/io.rb +352 -0
  40. data/lib/masterview/keyword_expander.rb +116 -0
  41. data/lib/masterview/masterview_version.rb +2 -2
  42. data/lib/masterview/mtime_tracking_hash.rb +44 -0
  43. data/lib/masterview/parser.rb +64 -92
  44. data/lib/masterview/pathname_extensions.rb +33 -0
  45. data/lib/masterview/template_spec.rb +49 -56
  46. data/lib/masterview.rb +40 -85
  47. data/test/fixtures/configs/fake_rails_app_with_config/config/masterview/environments/development.rb +12 -0
  48. data/test/fixtures/configs/fake_rails_app_with_config/config/masterview/environments/production.rb +11 -0
  49. data/test/fixtures/configs/fake_rails_app_with_config/config/masterview/settings.rb +23 -0
  50. data/test/fixtures/templates/product.html +256 -0
  51. data/test/fixtures/templates/test.import +80 -0
  52. data/test/test_helper.rb +5 -3
  53. data/test/tmp/template/foo.txt +1 -0
  54. data/test/tmp/templates_src/product.html +256 -0
  55. data/test/tmp/views/layouts/product.rhtml +35 -0
  56. data/test/tmp/views/product/_form.rhtml +30 -0
  57. data/test/tmp/views/product/_product.rhtml +14 -0
  58. data/test/tmp/views/product/_show.rhtml +27 -0
  59. data/test/tmp/views/product/destroy.rhtml +27 -0
  60. data/test/tmp/views/product/edit.rhtml +26 -0
  61. data/test/tmp/views/product/list.rhtml +31 -0
  62. data/test/tmp/views/product/new.rhtml +29 -0
  63. data/test/tmp/views/product/show.rhtml +16 -0
  64. data/test/unit/config_settings_test.rb +172 -0
  65. data/test/{attr_test.rb → unit/directive_attr_test.rb} +2 -2
  66. data/test/{block_test.rb → unit/directive_block_test.rb} +2 -2
  67. data/test/{content_test.rb → unit/directive_content_test.rb} +2 -2
  68. data/test/{else_test.rb → unit/directive_else_test.rb} +2 -2
  69. data/test/{elsif_test.rb → unit/directive_elsif_test.rb} +2 -2
  70. data/test/{form_test.rb → unit/directive_form_test.rb} +2 -2
  71. data/test/{global_inline_erb_test.rb → unit/directive_global_inline_erb_test.rb} +2 -2
  72. data/test/{hidden_field_test.rb → unit/directive_hidden_field_test.rb} +2 -2
  73. data/test/{if_test.rb → unit/directive_if_test.rb} +2 -2
  74. data/test/unit/directive_import_render_test.rb +62 -0
  75. data/test/{import_test.rb → unit/directive_import_test.rb} +2 -2
  76. data/test/{javascript_include_test.rb → unit/directive_javascript_include_test.rb} +2 -2
  77. data/test/{link_to_if_test.rb → unit/directive_link_to_if_test.rb} +2 -2
  78. data/test/{link_to_test.rb → unit/directive_link_to_test.rb} +2 -2
  79. data/test/{omit_tag_test.rb → unit/directive_omit_tag_test.rb} +2 -2
  80. data/test/{password_field_test.rb → unit/directive_password_field_test.rb} +2 -2
  81. data/test/{replace_test.rb → unit/directive_replace_test.rb} +2 -2
  82. data/test/{stylesheet_link_test.rb → unit/directive_stylesheet_link_test.rb} +2 -2
  83. data/test/{submit_test.rb → unit/directive_submit_test.rb} +2 -2
  84. data/test/{text_area_test.rb → unit/directive_text_area_test.rb} +2 -2
  85. data/test/{text_field_test.rb → unit/directive_text_field_test.rb} +2 -2
  86. data/test/{example_test.rb → unit/example_test.rb} +1 -1
  87. data/test/unit/file_mio_test.rb +368 -0
  88. data/test/{filter_helpers_test.rb → unit/filter_helpers_test.rb} +1 -1
  89. data/test/unit/keyword_expander_test.rb +95 -0
  90. data/test/unit/mio_test.rb +110 -0
  91. data/test/unit/mtime_string_hash_mio_tree_test.rb +289 -0
  92. data/test/unit/mtime_tracking_hash_test.rb +38 -0
  93. data/test/{parser_test.rb → unit/parser_test.rb} +19 -1
  94. data/test/unit/pathname_extensions_test.rb +46 -0
  95. data/test/{run_parser_test.rb → unit/run_parser_test.rb} +7 -3
  96. data/test/unit/string_hash_mio_test.rb +320 -0
  97. data/test/unit/template_file_watcher_test.rb +107 -0
  98. data/test/{template_spec_test.rb → unit/template_spec_test.rb} +57 -21
  99. data/test/{template_test.rb → unit/template_test.rb} +123 -22
  100. data/test/xtras/config-mv-logger_config.rb +109 -0
  101. data/test/xtras/config_initialize_standalone.rb +53 -0
  102. metadata +111 -38
  103. data/lib/masterview/extras/rails_init.rb +0 -72
  104. data/test/import_render_test.rb +0 -30
  105. data/test/template_file_watcher_test.rb +0 -50
data/TODO CHANGED
@@ -1,13 +1,18 @@
1
+ - create install.rb for rails 1.1 plugin installs, it will create config/masterview and some sample configs
1
2
  - create namespace for mv and publish, update generated files
2
- - video
3
+ - more videos
4
+ - image_tag (improve support for referencing image assets in MasterView directives markup)
5
+ - allow multiple namespace prefixes for directives (allow custom directives to declare their own namespace)
3
6
  - wiki for site
4
7
  - render from db
5
- - skip generation of ERB, provide way to get erb output
6
8
  - app for syntax
7
9
  - include additional stylesheets
8
10
  - ajax examples
9
11
  - ajax table component
10
- - investigate ways to improve splitting files and other team development issues
11
12
  - documentation
12
13
  - directive developer documentation and examples
13
14
  - more tests
15
+ - internal code cleanup
16
+ - DirectiveHelpers ERB_xx constants to differentiate ' %>' and ' -%>'
17
+ - replace MasterView::NamespacePrefix+'<gen/import directivename>' concats in parser/analyzer with directive attr name constants
18
+ - run spell checker on doc/*.html, ripple typo fixes back in rdoc comment
@@ -0,0 +1,485 @@
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
+
9
+ <title>MasterView - Configuration Guide</title>
10
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
11
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
12
+
13
+ <link href="./stylesheets/masterview.css" rel="stylesheet" type="text/css" />
14
+ <link href="./stylesheets/mv-config.css" rel="stylesheet" type="text/css" />
15
+ </head>
16
+
17
+ <body>
18
+
19
+ <div id="pageHeader">
20
+ <div>MasterView Template Engine</div>
21
+ <div class="description">Rails-optimized (x)html friendly template engine</div>
22
+ </div>
23
+
24
+ <div id="pageBody">
25
+ <div id="bodyContent" mv:generate="{template_path}" mv:omit_tag="">
26
+
27
+ <h1>MasterView - Configuration Guide</h1>
28
+
29
+ <p><span class="productName">MasterView</span> supports a number of options for configuring its operation.</p>
30
+
31
+
32
+ <div style="margin-left: 20px;">
33
+ <p style="padding-bottom: 4px; margin-bottom: 4px;"><a href="#mv_options_ref">MasterView Configuration Options Reference</a></p>
34
+ <ul> <!--TOC style-->
35
+ <li><a href="#mv_general_options">General Options</a> - root paths for config settings, directives, templates</li>
36
+ <li><a href="#mv_template_source_options">Template Source Options</a></li>
37
+ <li><a href="#mv_template_generation_options">Template Generation Options</a></li>
38
+ <li><a href="#mv_template_parsing_options">Template Parsing Options</a></li>
39
+ <li><a href="#mv_rails_app_options">Rails Application Options</a></li>
40
+ </ul>
41
+ </div>
42
+
43
+ <p>A standard set of configuration options are installed by default
44
+ that are suitable for a typical Rails application.
45
+ The goal is to allow Rails application developers to use
46
+ the <span class="productName">MasterView</span> plugin "out of the box",
47
+ with little or no initial setup effort: simply install the
48
+ <span class="productName">MasterView</span> plugin in a rails application
49
+ and start using the template engine facilities in its views.
50
+ </p>
51
+
52
+ <h2>Using MasterView in a Rails Application</h2>
53
+
54
+ <p>The standard configuration of <span class="productName">MasterView</span> in
55
+ a Rails application is to generate rhtml into the <code>RAILS_ROOT/app/views</code>
56
+ directory from template files in <code>RAILS_ROOT/app/views/masterview</code>.
57
+ The <code>mv:</code> attribute markup in the masterview templates determines
58
+ the content of the generated rhtml view templates, which are then used by the Rails controller/view dispatching mechanisms in the usual fashion.
59
+ </p>
60
+ <p>
61
+ By default, all masterview templates are parsed during rails application startup to ensure
62
+ that generated rhtml views are up-to-date for the application.
63
+ In a development environment, when Rails is reloading changed classes to dynamically
64
+ update the application code as you make changes,
65
+ <span class="productName">MasterView</span> will automatically
66
+ detect changes you make to your masterview templates and regenerate the rails rhtml views.
67
+ This ability to dynamically modify your rails application during development
68
+ is a key factor for the productivity of Rails developers, so
69
+ the <span class="productName">MasterView</span> designers have ensured
70
+ that you continue to have this capability when using masterview templates.
71
+ </p>
72
+
73
+ <p>You can customize <span class="productName">MasterView</span> operation
74
+ by modifying the standard set of configuration options.
75
+ To specify your configuration, create a <code>masterview</code> directory
76
+ in your Rails configuration directory (<code>RAILS_ROOT/config/masterview</code>).
77
+ Within this directory, create a <code>settings.rb</code> file containing
78
+ your application's configuration settings.
79
+ Options are set by assigning values to the <code>config</code> instance
80
+ that will be used to initialize <span class="productName">MasterView</span>.
81
+ </p>
82
+
83
+ <p>Just as with with your Rails configuration settings, you can optionally provide
84
+ environment-specific settings to override or augment your standard application settings.
85
+ To specify environment-dependent configuration settings, provide
86
+ additional config files in an <code>environments</code> subdirectory
87
+ (e.g., create <code>RAILS_ROOT/config/masterview/environments/development.rb</code>
88
+ to configure settings specifically for your development environment).
89
+ </p>
90
+
91
+ <h3>Sample <code>config/masterview/settings.rb</code> in a Rails Application</h3>
92
+
93
+ <pre><code>
94
+ # Application configuration settings for the MasterView template engine.
95
+ # Run at plugin load time during Rails startup (after the base rails
96
+ # framework is loaded and before the application's own startup logic
97
+ # in its config/environment.rb is run).
98
+ #
99
+ # Set standard application
100
+
101
+ # change the template source directory location for this application
102
+ # Specify relative path from RAILS_ROOT (config.root_path)
103
+ config.template_src_dir_path = 'app/masterview/templates' #default: 'app/masterview'
104
+
105
+ # Only use the MasterView admin pages for development
106
+ config.enable_admin_pages = false
107
+
108
+ # modify the default logging level from WARN to ERROR (only want to see serious errors)
109
+ config.logger = 'log4r'
110
+ config.log_level = 'ERROR'
111
+ config.after_initialize {
112
+ # we shouldn't see any of these in the log
113
+ MasterView.Log.debug "LOG CONFIG TEST: debug log entries suppressed at ERROR level"
114
+ MasterView.Log.info "LOG CONFIG TEST: info log entries suppressed at ERROR level"
115
+ MasterView.Log.warn "LOG CONFIG TEST: warning log entries suppressed at ERROR level"
116
+ # so this is the only log message that should get through
117
+ #MasterView.Log.error "LOG CONFIG TEST: only serious messages are reported at ERROR level"
118
+ }
119
+
120
+ </code></pre>
121
+
122
+ <h3>Sample <code>config/masterview/environments/development.rb</code> in a Rails Application</h3>
123
+
124
+ <pre><code>
125
+ # Application configuration settings for the MasterView template engine.
126
+ #
127
+ # Set development-mode config settings here
128
+
129
+ # Only use the MasterView admin pages for development
130
+ config.enable_admin_pages = true
131
+
132
+ # include debug and all info/warning/error log messages during development
133
+ config.log_level = 'DEBUG'
134
+
135
+ </code></pre>
136
+
137
+ <h2>Using MasterView outside Rails</h2>
138
+
139
+ <p><span class="productName">MasterView</span> has been designed so that it can also be
140
+ used independently of the Rails application context.
141
+ Outside Rails, you need to explicitly run the <code>MasterView::Initializer</code>
142
+ in your application startup code.
143
+ While the Rails framework handles masterview loading automatically through its
144
+ framework startup and plugin loading facilities,
145
+ with configuration settings files obtained from standard locations within the
146
+ overall structure of a rails application,
147
+ a non-rails application using the MasterView template engine needs to initiate
148
+ loading the template engine and providing it with configuration information.
149
+ </p>
150
+
151
+ <pre><code>
152
+ require 'masterview/initializer'
153
+ config = MasterView::Configuration( :app_root_path = '/path/to/my/app' )
154
+ # This app has simple config, so it won't use the config files scheme used in Rails.
155
+ # We just specify our directory locations within the app right here.
156
+ config.template_src_dir_path = 'masterview/templates' # rel path from app's root_path
157
+ config.template_dst_dir_path = 'masterview/output'
158
+ Masterview::Initializer(:process, config)
159
+ </code></pre>
160
+
161
+ <hr />
162
+ <a name="mv_options_ref" />
163
+ <h2>MasterView Configuration Options</h2>
164
+
165
+ <a name="mv_general_options" />
166
+ <h3>General Options</h3>
167
+ <table class="settings_table" summary="general options">
168
+ <thead>
169
+ <tr><th>Option</th><th>Default</th><th>Description</th></tr>
170
+ </thead>
171
+ <tbody>
172
+ <tr>
173
+ <td class="setting">root_path</td>
174
+ <td class="default">RAILS_ROOT or '.'</td>
175
+ <td class="description">Path to the root location of the application.
176
+ </td>
177
+ </tr>
178
+ <tr>
179
+ <td class="setting">config_dir_path</td>
180
+ <td class="default">RAILS_ROOT/config/masterview or nil</td>
181
+ <td class="description">Path to the directory containing the application's config settings.
182
+ <div class="explanation">Specified as a relative path from the <code>root_path</code>.</div>
183
+ </td>
184
+ </tr>
185
+ <tr>
186
+ <td class="setting">environment</td>
187
+ <td class="default">RAILS_ENV or nil</td>
188
+ <td class="description">The current execution environment, if applicable.
189
+ <div class="explanation">Used for locating environment-specific settings in the config directory, if available.</div>
190
+ </td>
191
+ </tr>
192
+ <tr>
193
+ <td class="setting">directive_paths</td>
194
+ <td class="default">&nbsp;</td>
195
+ <td class="description">Paths of directories to load directives from.
196
+ <div class="explanation">Directory for built-in <code>MasterView</code> directives is included by default.
197
+ Append additional directories to load custom directives (e.g., <code>config.directive_paths << /path/to/my/directives</code>).
198
+ </div>
199
+ </td>
200
+ </tr>
201
+ <!--DROPPED OUT [JJB 14-Jun-2006]
202
+ <tr>
203
+ <td class="setting">rebuild_backups_tmp_dir_path</td>
204
+ <td class="default">RAILS_ROOT/tmp/masterview/rebuild/backups or nil</td>
205
+ <td class="description">Relative path from the application's <code>root_path</code> of temp directory used for creating backup files before rebuilding/updating a template file.
206
+ <div class="explanation">Set to <code>nil</code> to suppress backups.</div>
207
+ </td>
208
+ </tr>
209
+ -->
210
+ <tr>
211
+ <td class="setting">logger</td>
212
+ <td class="default">Log4r if available, otherwise standard ruby Logger</td>
213
+ <td class="description">Logger which will be used to output debug, warning, and error messages.
214
+ <div class="explanation">Supported loggers:
215
+ <br />
216
+ <code>'log4r'</code> - the Log4r logger
217
+ <br />
218
+ <code>'logger'</code> - ruby standard library logger
219
+ </div>
220
+ </td>
221
+ </tr>
222
+ <tr>
223
+ <td class="setting">log_level</td>
224
+ <td class="default"><code>INFO</code> for development, otherwise <code>WARN</code></td>
225
+ <td class="description">Specify the name of the logging severity level.
226
+ <div class="explanation">Logging levels names may be logger-dependent.</div>
227
+ </td>
228
+ </tr>
229
+ <tr>
230
+ <td class="setting">after_initialize</td>
231
+ <td class="default">nil</td>
232
+ <td class="description">Optional block which will be executed after MasterView
233
+ has been fully initialized.
234
+ </td>
235
+ </tr>
236
+ <!--####
237
+ <tr>
238
+ <td class="setting">XXX</td>
239
+ <td class="default">&nbsp;</td>
240
+ <td class="description">&nbsp;</td>
241
+ </tr>
242
+ ###-->
243
+ </tbody>
244
+ </table>
245
+
246
+ <a name="mv_template_source_options" />
247
+ <h3>Template Source Options</h3>
248
+ <table class="settings_table" summary="template source options">
249
+ <thead>
250
+ <tr><th>Option</th><th>Default</th><th>Description</th></tr>
251
+ </thead>
252
+ <tbody>
253
+ <tr>
254
+ <td class="setting">template_src_dir_path</td>
255
+ <td class="default">RAILS_ROOT/app/masterview (rails)
256
+ <br />{root_path}/masterview/templates<br />(non-rails app)</td>
257
+ <td class="description">Path to the directory where masterview templates are located.
258
+ <div class="explanation">
259
+ Specify the location of your template source directory as a relative path from the application's <code>root_path</code> directory.
260
+ Use <code>config.template_src_dir_abs_path(abs_path)</code> to specify the template source directory as an absolute path.
261
+ </div>
262
+ </td>
263
+ </tr>
264
+ <tr>
265
+ <td class="setting">template_filename_pattern</td>
266
+ <td class="default">*.html</td>
267
+ <td class="description">Filename pattern for masterview template files within the template source directory.</td>
268
+ </tr>
269
+ <!--####
270
+ <tr>
271
+ <td class="setting">XXX</td>
272
+ <td class="default">&nbsp;</td>
273
+ <td class="description">&nbsp;</td>
274
+ </tr>
275
+ ###-->
276
+ </tbody>
277
+ </table>
278
+
279
+ <a name="mv_template_generation_options" />
280
+ <h3>Template Generation Options</h3>
281
+ <table class="settings_table" summary="template generation options">
282
+ <thead>
283
+ <tr><th>Option</th><th>Default</th><th>Description</th></tr>
284
+ </thead>
285
+ <tbody>
286
+ <tr>
287
+ <td class="setting">template_dst_dir_path</td>
288
+ <td class="default">RAILS_ROOT/app/views(rails)
289
+ <br />{root_path}/masterview/output<br />(non-rails app)</td>
290
+ <td class="description">Path to the directory where Masterview template output (rhtml) will be generated.
291
+ <div class="explanation">
292
+ Specify the location of your template output directory as a relative path from
293
+ the application's <code>root_path</code>.
294
+ Use <code>config.template_dst_dir_abs_path(abs_path)</code> to specify the template output directory as an absolute path.
295
+ </div>
296
+ </tr>
297
+ <tr>
298
+ <td class="setting">output_filename_extension</td>
299
+ <td class="default">.rhtml</td>
300
+ <td class="description">Filename extension to use for generated output files if not specified.
301
+
302
+ </td>
303
+ </tr>
304
+ <tr>
305
+ <td class="setting">generated_file_default_extension</td>
306
+ <td class="default">.rhtml</td>
307
+ <td class="description">Filename extension to use for generated files if not specified.</td>
308
+ </tr>
309
+ <tr>
310
+ <td class="setting">include_generated_file_comment</td>
311
+ <td class="default">true</td>
312
+ <td class="description">
313
+ Boolean which controls whether to include a comment in template
314
+ output files indicating that the file was generated by MasterView.
315
+ <div class="explanation">By default, a warning comment is generated in template output files indicating that the file was generated by MasterView from a template and should not be directly edited, as any changes would be lost when the output file is regenerated.</div>
316
+ </td>
317
+ </tr>
318
+ <tr>
319
+ <td class="setting">generated_file_comment</td>
320
+ <td class="default">&nbsp;</td>
321
+ <td class="description">Text for generated-file comment inserted in rhtml template output files generated by MasterView.
322
+ <div class="explanation">Standard comment includes the name of the master template file which contains the source to edit.
323
+ Variable substitution on the comment text will replace <code>#{template_path}</code>
324
+ with the pathname of the source template file.
325
+ </div>
326
+ </td>
327
+ </tr>
328
+ <!--####
329
+ <tr>
330
+ <td class="setting">XXX</td>
331
+ <td class="default">&nbsp;</td>
332
+ <td class="description">&nbsp;</td>
333
+ </tr>
334
+ ###-->
335
+ </tbody>
336
+ </table>
337
+
338
+ <a name="mv_template_parsing_options" />
339
+ <h3>Template Parsing Options</h3>
340
+ <table class="settings_table" summary="template parsing options">
341
+ <thead>
342
+ <tr><th>Option</th><th>Default</th><th>Description</th></tr>
343
+ </thead>
344
+ <tbody>
345
+ <tr>
346
+ <td class="setting">handle_parse_exceptions</td>
347
+ <td class="default">true</td>
348
+ <td class="description">Continue template parsing after logging parse exceptions.</td>
349
+ </tr>
350
+ <tr>
351
+ <td class="setting">default_parser_options</td>
352
+ <td class="default">hash containing parser options</td>
353
+ <td class="description">Options for parser operation</td>
354
+ </tr>
355
+ <tr>
356
+ <td>&nbsp;</td>
357
+ <td class="default"><b>:tidy</b> => false</td>
358
+ <td class="description">Run tidy before processing template
359
+ <div class="explanation">(must set <code>tidy_path</code>)</div>
360
+ </td>
361
+ </tr>
362
+ <tr>
363
+ <td>&nbsp;</td>
364
+ <td class="default"><b>:escape_erb</b> => true</td>
365
+ <td class="description">Escape <code>&lt;%&nbsp;%&gt;</code> before parsing</td>
366
+ </tr>
367
+ <tr>
368
+ <td class="setting">tidy_path</td>
369
+ <td class="default">&nbsp;</td>
370
+ <td class="description">Path on this system to tidy library if <b>:tidy</b> parser option is enabled so that masterview templates will be run through tidy before being parsed.</td>
371
+ </tr>
372
+ <tr>
373
+ <td class="setting">namespace_prefix</td>
374
+ <td class="default">mv:</td>
375
+ <td class="description">XML name space prefix for MasterView directive attributes in template html.</td>
376
+ </tr>
377
+ <tr>
378
+ <td class="setting">inline_erb_start</td>
379
+ <td class="default">{{{</td>
380
+ <td class="description">Xhtml safe substitution for <code>&lt;%</code> in a masterview template.</td>
381
+ </tr>
382
+ <tr>
383
+ <td class="setting">inline_erb_end</td>
384
+ <td class="description">}}}</td>
385
+ <td class="description">Xhtml safe substitution for <code>%&gt;</code> in a masterview template.</td>
386
+ </tr>
387
+ <tr>
388
+ <td class="setting">inline_erb_substitution_regex</td>
389
+ <td class="default">&nbsp;</td>
390
+ <td class="description">regex used to find escaped inline_erb markup.
391
+ <div class="explanation">Needs to match <code>inline_erb_start</code> and <code>inline_erb_end</code></div>
392
+ </td>
393
+ </tr>
394
+ <!--####
395
+ <tr>
396
+ <td class="setting">XXX</td>
397
+ <td class="default">&nbsp;</td>
398
+ <td class="description">&nbsp;</td>
399
+ </tr>
400
+ ###-->
401
+ </tbody>
402
+ </table>
403
+
404
+ <a name="mv_rails_app_options" />
405
+ <h3>Rails Application Options</h3>
406
+ <table class="settings_table" summary="rails application options">
407
+ <thead>
408
+ <tr><th>Option</th><th>Default</th><th>Description</th></tr>
409
+ </thead>
410
+ <tbody>
411
+ <tr>
412
+ <td class="setting">parse_masterview_templates_at_startup</td>
413
+ <td class="default">true</td>
414
+ <td class="description">Boolean which determines whether masterview templates are parsed during initial application startup loading.
415
+ <div class="explanation">If the auto-parse option is disabled, template parsing must be manually triggered by the application developer.</div>
416
+ </td>
417
+ </tr>
418
+ <tr>
419
+ <td class="setting">reparse_changed_masterview_templates</td>
420
+ <td class="default">true if both template parsing at startup and ActionController class reloading are enabled</td>
421
+ <td class="description">Boolean which determines whether masterview templates are automatically reparsed if the template changes after initial application loading.
422
+ </td>
423
+ </tr>
424
+ <tr>
425
+ <td class="setting">enable_admin_pages</td>
426
+ <td class="default">false</td>
427
+ <td class="description">Enable MasterView admin pages in the rails application. If config/masterview/environments/production.rb was created during installation then the default is false in production mode.
428
+ <div class="explanation">Enables the masterview admin controller at <code>http://yourappdomain/masterview</code>.</div>
429
+ </td>
430
+ </tr>
431
+ <tr>
432
+ <td class="setting">enable_view_rhtml</td>
433
+ <td class="default">false</td>
434
+ <td class="description">Enable MasterView admin pages in a rails application to be able to view the generated rhtml. When enabled it creates links on the list page to click to view the rhtml source. Requires that enable_admin_pages is true. If config/masterview/environments/production.rb was created during installation then the default is false in production mode.
435
+ <div class="explanation">This functionality is useful for understanding how your templates are being interpretted (ie. what rhtml is being generated by them) and for debugging. For security reasons you would probably disable this feature in production (or disable admin pages altogether).</div>
436
+ </td>
437
+ </tr>
438
+ <tr>
439
+ <td class="setting">generate_rhtml_files</td>
440
+ <td class="default">false</td>
441
+ <td class="description">Boolean which controls whether to generate rhtml (erb) files to file system and have rails load from there, otherwise Rails will load directly from MasterView.
442
+ <div class="explanation">If this setting is false, then several methods in the rails controller and view will be enhanced to be able to read erb directly from MasterView in addition to being able to read the erb on the file system. If this setting is true then rhtml(erb) files will be generated to file system and rails will read them from there in the traditional manner.</div>
443
+ </td>
444
+ </tr>
445
+ <!--####
446
+ <tr>
447
+ <td class="setting">XXX</td>
448
+ <td class="default">&nbsp;</td>
449
+ <td class="description">&nbsp;</td>
450
+ </tr>
451
+ ###-->
452
+ </tbody>
453
+ </table>
454
+
455
+ </div> <!-- bodyContent -->
456
+ </div>
457
+
458
+ <div id="pageFooter">
459
+ <div>
460
+ &middot;&nbsp;
461
+ <a href="./index.html">Doc Home</a>
462
+ &nbsp;|&nbsp;
463
+ <a href="./installation.html">Installation</a>
464
+ &nbsp;|&nbsp;
465
+ <a href="./configuration.html">Configuration</a>
466
+ &nbsp;|&nbsp;
467
+ <a href="./guide.html">Usage</a>
468
+ &nbsp;|&nbsp;
469
+ <a href="./directives.html">Directives</a>
470
+ &nbsp;&middot;
471
+ </div>
472
+ <table summary="layout area">
473
+ <tbody>
474
+ <tr>
475
+ <td class="copyright">&copy;&nbsp;Copyright MasterView 2006</td>
476
+ <td class="validators">
477
+ <a href="http://validator.w3.org/check/referer">[Valid XHTML]</a>
478
+ </td>
479
+ </tr>
480
+ </tbody>
481
+ </table>
482
+ </div>
483
+
484
+ </body>
485
+ </html>