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 (jeff.barczewski @ gmail.com) |
Primary developers: | Jeff Barczewski, Deb Lewis |
Website: | masterview.org |
Rubyforge project: | masterview |
License: | MIT open source license (like Rails) |
Mailing lists: | Join mailing lists at rubyforge.org |
masterview-announce - MasterView release announcements | |
masterview-users - Discussion, problems, ideas, suggestions for MasterView | |
masterview-devel - MasterView project developer list | |
Videos: | MasterView Quick Start Video - demonstrating basic usage of MasterView (no audio) |
Requires: | No external dependencies |
Optional: | tidy, log4r |
See the MasterView Installation Guide for details.
See the MasterView Installation Guide for complete installation instructions.
See the MasterView Configuration Guide for informatino about customizing the MasterView configuration settings for your application.
See the MasterView User's Guide for information on using MasterView templates and supporting services.
See the MasterView Directives Reference for complete descriptions of all the standard built-in MasterView directives.
I came from a Java Struts environment when I was introduced to Ruby. I was just in the process of evaluating Tapestry and JSF when I learned about Rails. Ruby and Rails changed my world forever. I had to however drop many of my bad habits aquired from years of Java and C++ work. I had to embrace the new ideas and approach things now with a different mindset. (If you ever have a chance to hear Dave Thomas speak, you will know what I mean. He has a wonderfully entertaining yet enlightening way of illustrating this.)
After learning the Ruby and Rails way, (Thank you Matz and DHH for such wonderful gifts to the world) I was amazed at how productive this environment is. Programming was fun once again, and everything you do in Ruby or Rails is easier than any other language or framework I have ever seen. Even taking into account having to learn something new, I was still far more productive than ever before. The only thing that I felt that could be done better, was to have a nice html friendly templating engine so that designers and developers could work collaboratively together on a project. The designers could style and layout the pages with their WYSIWYG HTML editors and developers would have the full power of Ruby and Rails without having to jump through extra hoops to use them. I looked at the available html template engines to see if anything fit with my style. I was disappointed with each of them, mainly because they all made it harder than straigt ERb (rhtml) and were not able to use layouts and partials easily.
After all the hard work so many people have put into Ruby and Rails, I wanted to see if there was anyway I could contribute as well, maybe extending one of the existing template projects to have the ideal functionality I was striving for. I wanted something to make my own web development even more productive. However after reviewing each of them and even getting into the source code, the closest ones seemed to be Amrita2, Liquid, and Kwartz. Unfortunately it was not going to be easy to add the functionality and usability I desired.
During my research I learned that many of the rails gurus were putting down html template engines because they felt that they handicapped the developer severely, namely by not taking advantage of rails layouts, partials, and html helpers. After doing some projects with ERb (rhtml) I realized that they were right. I too did not want to give up any of that power either. I also didn’t want to create a bunch of extra code or config to use the templates (extra view code, or data structures to pass to the templates) as so many of the other engines relied on.
I expanded my search outside of Ruby for the best html template technology I could find. After reviewing all the front runners I still didn’t find anything that quite met with my goals for developing with ruby and rails. I also didn’t find any technology that was close enough that I could adapt it. However I did come across features in a variety of systems that inspired me, and helped me shape the ideas that are presented here. A few of those systems were Tapestry, Zope/PHP TAL, Kwartz, Amrita 2, Liquid, and Web Objects.
After putting much thought into all the possible options I could not see extending an existing template engine to meet my needs. And since I wanted this engine to have all the power of ruby and rails, it seemed that I would be best served by developing a html template syntax that was a thin layer above ERb. That way it would be intuitive to use (not having to learn yet another syntax) yet very powerful. Once I was able to come up with the desired syntax and approach it became apparent that this would also be fairly straightforward to build.
I ran the concept by the guys at the St. Louis Ruby Group stlruby.org and they were excited about the project. With their help I was able to simply some of the confusing or complicated areas before beginning development. They also sparked some ideas about how to make this infinitely extensible such that developers could easily add their own attribute directives. This would give them the power to create custom extensions that would encapsulate some of their development work. This would serve a couple needs, it would not only make this engine extensible, it would also allow this engine to grow easily being composed of small pluggable attribute directives. Many thanks to the members of this group, I continue to enjoy discussing the power of Ruby and learning from each of them on a monthly basis.
While I am on the subject of thanks, I would like to thank my wife and daughter for their support as I took time away from them to work on this project and I want to thank God for bringing the right people into my life just when I needed them and for bringing me on this wonderful journey, I am so very blessed. May I be able to give back some of what has been given to me.
And one more mention of tremendous thanks to Deb Lewis, the other core developer on the team, she has spent countless hours reviewing, revising, and improving the codebase, configuration, and documentation. The project wouldn't be half of what it is today without all her help, inspiration, and hard work. I thoroughly enjoy working and debating the finer points of the project with her each step of the way.
So that’s the story, I hope that many of you will find MasterView to be a useful tool for your development. I am continuing to refine MasterView by using it daily for Genesis Ministry sites and all my web projects. I know that there is much more work needed in documentation, examples, test cases, additional directives, etc., so I would appreciate any feedback and ideas that you have. Thanks for taking the time to review MasterView!
Jeff Barczewski (jeff.barczewski @ gmail.com)