Files | Admin

Notes:

Release Name: REL 0.2.4

Notes:
= MasterView - Rails-optimized (x)html friendly template engine 

== Recent changes (Release 0.2.3)

Changed default development settings for enable_admin_pages and
enable_view_rhtml = true (false in production) to make it easy
for new users to get up and running. Added check_box, radio_button,
select, collection_select directives. Refactor attr_value parsing 
to be more robust taking into account nested objects. Internal rework
of directive handling to support alternate namespaces for directives.
Std app directives dir at rails app/masterview/directives will be
automatically added to MasterView load path if exists.


== Recent changes (Release 0.2.2)

Fixes problem when rails encounters exception in either compiling or
involving RuntimeError in the generated rhtml. The rails TemplateError
class looks at the file system for the template contents. So when 
generate_rhtml is false (no file is generated) rails was not able to 
find source and was not outputting an error page. Rails TemplateError
class was extended to look at MasterView store first and then fallback
to file system.

== Recent changes (Release 0.2.1)

Release 0.2.1 adds Mongrel support, a new image_tag directive
and some additional illustrations and links to videos. Also 
javascript_include and stylesheet_link directives can infer the
path from the src attribute if the attr_value is empty.

Also added additional logging around startup and the version of 
MasterView that is running and a new admin page to visually
see what MasterView features are currently loaded (tidy,
auto parsing on change, parse on startup, reading rhtml direct
from masterview (eliminating rhtml file generation))


== Recent changes (Release 0.2.0)

Release 0.2.0 features a number of significant improvements.

MasterView templates can now be compiled directly into the Rails
view cache, just like .rhtml files in your app/views directory.
Output generation of .rhtml files from a MasterView template
is now optional.

A keyword substitution mechanism is now supported for the
mv:generate and mv:import group of template processing directives
to enable you to more easily specify standard output file names
derived from the template filename and relative path.
Template markup of the form:

  mv:generate="{template_path}"

avoids having to replicate the name of the template file itself
or its relative path within the masterview templates directory.
See the MasterView User's Guide and Directives Reference for details.

A new configuration facility has been added to allow you to
customize the MasterView configuration using settings
files in your rails app config directory, following the
same approach as the Rails framework itself.
See the new Configuration Guide documentation for details.

Configuration settings for controlling logging level have been added.
The MasterView admin controller is now disabled by default.
Use the config.enable_admin_pages setting to enable
(usually want only in your config/masterview/environments/development.rb).

The documentation has been reworked and enhanced to provide
improved documentation on installation and usage, along with
a new Configuration Guide describing how to customize the
MasterView configuration.

UPGRADE NOTES: If you have customized your MasterView configuration
in the init.rb file of your existing plugin installation, you *MUST* 
migrate your configuration to the new settings file configuration mechanism
(config/masterview/settings.rb and environment settings files).

Also note that a directive was renamed from gen_render to gen_partial to 
more clearly represent the functionality and eliminate future confusion.
Be sure to change any references to gen_render to gen_partial.

The default location for MasterView templates is now the standard Rails 
app/views directory.  Either move your existing templates into app/views 
or update the MasterView config.template_src_dir_path setting in your
config/masterview/settings.rb to reference your existing templates source 
directory.

== Recent changes (Release 0.1.0)

MasterView now by default generates five masterview template files instead 
of one, though you can specify the --single-file option to only generate 
one file. Using one masterview template file gives the most DRY implementation 
but since all the views are in one file, it can become a point of contention 
and is a little more difficult for designers to work with. 
This Version 0.1.0 upgrade fixes that by generating one masterview template 
for each action (list, new, edit, show, destroy). The layout and message 
partials are defined in the list template and are imported into the other 
files so that you can have a complete page rendering when working with style 
and design of page. Similarly new defines the form partial which is imported 
into edit, and show defines a _show partial which is imported into destroy.

One can edit the layout or other partials in the file they are defined in, 
so for instance to edit the layout, edit the list template and once finished, 
you can trigger the other templates to be rebuilt with the current information. 
MasterView now contains an MasterView admin controller/view to visually see 
all the status and details about the templates. You can rebuild any out of sync 
templates from this page. Alternatively you can view and rebuild templates from 
the command line as well using the built in rake commands (mv:list, mv:list_all, 
mv:rebuild TEMPLATE=foo.html, mv:rebuild_all).

To make it easy to add additional actions which also import the layout, 
MasterView now has a way to generate a starter template file for your action 
by simply choosing from which other template file you want to import the layout 
from. For instance say you want to add an action called hello to your Product 
controller. Find the masterview template you want to get the layout imported 
from which could be (product_list.html, product_new.html, product_edit.html, ...), 
you can choose any of the templates that have the layout you want (it doesn't 
matter whether they defined the layout or simply imported it. To generate the 
starter template go to the MasterView Admin page http://yourserver/masterview 
and click copy link next to the appropriate template. On the next screen indicate 
the name of the action you wish to add (in this case 'hello') and click the submit 
button. MasterView generates a starter template file product_hello.html which 
imports the layout from the template file you chose and it creates some 
placeholder divs in the template that you can edit to add your hello view code. 
Alternatively there is also a 
    rake mv:copy_layout TEMPLATE=product_list.html ACTION=hello 
command to allow you to do the same thing via command line.

Note that you don't have to use the starter or generated files to use MasterView 
(you can just add MasterView attribute directives manually), but I found that 
once you had things started and wanted to reuse that same information, that 
having an automated way to get the layout imported makes it much easier and 
quicker to get things going. You can also change the default action div that is 
generated by simply creating your own file in app/views/masterview/admin/empty.rhtml 
which if found the copy_layout will use it, otherwise it uses the one from the gem/plugin. 

== Description

MasterView is a ruby/rails optimized HTML/XHTML friendly template engine. 
It is designed to use the full power and productivity of rails including 
layouts, partials, and rails html helpers while still being editable/styleable 
in a WYSIWYG HTML editor.  

MasterView is distributed as a gem or a plugin. You may install it as a gem and 
then generate a lightweight plugin which mainly refers to the gem *or* you can 
simply install as a plugin which is self contained. I personally prefer installing 
as a gem for ease of management, however if you are running at a shared hosting 
environment you might not have authority to install this gem so you may install 
as a self contained plugin.

If you are interested in the background story behind all this, it is at the end of this page.

Author:: Jeff Barczewski
Email:: jeff.barczewski @ gmail.com
Primary developers:: Jeff Barczewski, Deb Lewis
Website:: http://masterview.org
Rubyforge project:: masterview
License:: MIT open source license like Rails

== Goals

- Create/extend a template engine for rails that would be XHTML friendly and thus could be edited/styled with a WYSIWYG HTML editor even late in development without breaking template.
- Keep it simple. DRY. No extra config files, simple syntax with ruby flavor.
- Design it specifically for ruby and rails. Use the full power and not be limited in its capabilities over what can be done with ERb
- Work nicely with layouts, partials, and rails html helpers.
- Reduce complexity, work with existing rails code, no extra view logic or hashes than what is used by ERb. Scaffold generate initial templates or work from existing html prototype.
- Reduce the numbers of files, simplifying editing. Define partials and layouts naturallyl right in the template, no need to go to another file.
- Preview in browser without running an app. Allow for dummy data in the template so that the page can be viewed and styled independently of the application.
- Performance equal to ERb

== Prerequisites

Requires::
	No external dependencies

Optional::
	tidy (gem) and tidy library - if these are installed you can use tidy to cleanup html into valid xhtml for use by MasterView
	log4r (gem) - if this gem is installed then MasterView will use it for logging otherwise it defaults to using built in Logger.

== User Documentation

MasterView documentation is available online at the MasterView site:
  http://www.masterview.org 
and on the rubyforge project
  http://rubyforge.org/projects/masterview/

== Installation

Detailed installation instructions for installing the masterview gems
or a self-contained copy of the plugin is provided in the MasterView
Installation Guide.

The Configuration Guide describes how to customize the configuration
of the MasterView template engine for your application.

== Usage

The MasterView User's Guide and a complete Directives Reference are provided
in the MasterView user documentation.  MasterView templates can be
created by hand simply by adding masterview directives markup to
an (x)html template, or generated for typical Rails controller/view
scenarios using the supplied masterview generator developer tool.

A MasterView Admin controller can optionally be activated in your application
to assist you during development with creating and managing your templates.


Changes: 0.2.4 Added interactive render to admin pages with example templates Fixed problem where apache2 with scgi was failing to initialize MasterView Updated documentation. 0.2.3 - July 5th, 2006 Change default development settings for enable_admin_pages = true and enable_view_rhtml = true, remains false in production. Change generated message in files to indicate that list.html controls layout and _messages, while new.html controls _form... Added check_box directive Added radio_button directive Refactored attr_value option parser Added select directive Added config setting template_asset_base_ref_pattern, index by asset type, for extracting asset refs from template design-time refs for rails helpers. Internal rework of directive handling to provide infrastructure for enable alt directive name spaces (separate from builtin mv: namespace). Std app directives dir at rails app/masterview/directives will be automatically added to load path along with builtin mv: directives if present. Added quote_if method to directive_base and refactored directives to utilize so logic is consolidated. Added collection_select directive 0.2.2 - June 30th, 2006 - Fix bug when not generating rhtml that rails template error could not find source and thus would fail to generate rhtml error page 0.2.1 - June 28th, 2006 Added Mongrel support Added image_tag directive Update javascript_include directive to infer path from src if attr_value is empty Update stylesheet_link directive to infer path from src if attr_value is empty New illustration 0.2.0 - June 20th, 2006 - Big release. Added capability for eliminating rhtml generation, extends rails so that rhtml can be pulled directly from MasterView. Support template compilation directly into Rails view cache for templates in app/views (rhtml generation now optional) New mechanism for configuring MasterView from settings files; internal initialization rework. Configuration can now be driven by editing config/masterview/settings.rb and/or config/masterview/environments/*.rb. Add support for configuring MasterView logger and log_level; default level INFO for dev, WARN otherwise Add keyword substitution for generate/import attributes (mv:generate="{template_path}" notation) Added capability to view rhtml from MasterView Admin pages. Add 'View Configuration' page in MasterView Admin pages to display config settings. Reorganize and enhance documentation: doc/index.html; improved installation guide, added config guide, improved User Guide Internals: Renamed PartialExtension to GeneratedFileDefaultExtension Internals: Renamed partial_filename_extension to generated_file_default_extension Internals: Major internal rework of file handling and I/O. --UPGRADE NOTE: you *must* redo any config customizations in plugin init.rb to use new settings file and config vars --UPGRADE NOTE: default location for masterview template files is now the app/views directory in your Rails app --UPGRADE NOTE: directive gen_render was renamed gen_partial for clarity, update any templates which reference gen_render 0.1.6 - June 2nd - Implement basic dateselect and datetime_select in generator. Simplify only empty elements that are specified as empty in xhtml-1.0-Strict DTD. 0.1.5 - May 31st - Remove app_[ENV] customization hook in leau of a block based initializer approach (similar to rails) from Deborah Lewis which would allow customization from the environment config files. 0.1.4 - May 30th - Apply patch by Deborah Lewis to allow customized generated comment. Add omit_tag directive to conditionally suppress output of element tag. Add user configuration user.rb, user_RAILS_ENV.rb 0.1.3 - May 29th - Fixed generators to use m.file not m.template on non-erb files 0.1.2 - May 29th - Fix empty.rhtml not being found from rake mv:copy_layout 0.1.1 - May 29th - Fix minor issue with gem, masterview rake tasks were not availailable when using gem 0.1.0 - May 27th - Major additions. Added rake admin tasks, MasterView admin controller/views. Allow user to easily have distributed files and keep sync'd. Generator defaults to generating split files. 0.0.18 - May 12, 2006 - Refactored watcher 0.0.17 - May 4, 2006 - Added some additional css style and generator options, change the showOne option 0.0.16 - April 28, 2006 - Corrected gem version dependencies 0.0.15 - April 28, 2006 - Added gem version dependencies spec for masterview_gem_pack so that pack pulls the appropriate versions 0.0.14 - April 28, 2006 - Fixed a preview problem introduced by design time stylesheet inclusion. Show and Destroy content was hidden. Clarified design time message. 0.0.13 - April 27, 2006 - Cleaned up generated template improving indentation and simplified css. Added design time css to hide sections. Preview javascript was changed to be less invasive to generated code. 0.0.12 - April 24, 2006 - Fixed generator to use Controller name for files it generates, added attr directive, added more default styles to css, added styles to generator templates 0.0.11 - April 22, 2006 - Changed the main load file to rescue LoadErrors from log4r and tidy 0.0.6 - April 18, 2006 - Working on generator packaging 0.0.5 - April 18, 2006 - Changed packaging 0.0.4 - April 18, 2006 - Updated documentation 0.0.3 - April 18, 2006 - Repackaging 0.0.2 - April 16, 2006 - First public release