From jeff.barczewski at gmail.com Thu Oct 4 11:01:45 2007 From: jeff.barczewski at gmail.com (Jeff Barczewski) Date: Thu, 4 Oct 2007 15:01:45 +0000 Subject: [Masterview-users] [ANN] MasterView 0.3.4 Rails-optimized (x)html template engine Message-ID: <19cda190710040801w181cd973hf2a157deb24c594c@mail.gmail.com> = MasterView - Rails-optimized (x)html friendly template engine MasterView is a template engine plugin that provides another option to the existing rails view templates (rhtml and rxml). This template engine has all the power of layouts, partials, and rails helpers but is still editable/styleable in a WYSIWYG editor. Another major goal it to have the syntax of these attribute directives be very similar to rails helpers so that one could intuitively start using MasterView with little learning curve other than knowing rails. MasterView users can additionally create their own directives to encapsulate custom functionality so the system can be easily extended into specific uses. MasterView was inspired by Amrita, Kwartz, Tapestry, Zope/PHP TAL, Liquid, and Web Objects but designed with a fresh approach and specifically targetted for rails users. There are several ways to use MasterView: - Start with a pure HTML prototype of your site and add directives to the pages to make them live. You can continue to WYSIWYG edit HTML prototype throughout project life cycle. (See screencast for demonstration) - If you don't have an HTML prototype and want to generate a CRUD application, you may use the MasterView generator which creates a styled CRUD application which you can then change as needed. - If you already have an application but would like to use MasterView, you can start to use MasterView for new pages. MasterView will co-exist nicely with existing rhtml and you can slowly evolve the site over time. == Recent changes (Release 0.3.4) - Partial enhancement and maintenance Make values in gen_partial and import_partial retain their page specific values, allowing you to specify different locals, collections, or objects for import_render than you do on gen_partial. Also allows you to reuse the partial multiple times on a page with different values. (thanks James Britt) Fix rebuild template so that it uses the same list of XHTML empty elements to determine whether to collapse empty elements (thanks to Brian Jordan) Fixed a problem with CruiseControl where ActionController was not defined when masterview was initialized. (thanks James Britt) Added mv:generate_all_rhtml rake task which generates all rhtml files to make it more obvious for users who want to generate the rhtml files. Also changed the way gen_partial and import_render work with regards to collections, object, and locals, they now retain the values from the page even after rebuild. This allows you to have different values on each page and even different values on the same page if use partials multiple times on a page. == Recent changes (Release 0.3.3) - Maintenance release plus auto_copy Added auto copy feature which can be configured to automatically copy static files like stylesheets, images, and javascripts from a non-standard location to the proper location at runtime (under Rails public). This makes it easy to use HTML prototypes and associated files with MasterView eliminating any manual copying. This release fix adds doctype to generated code, and a bug in gen_replace which outputted <% %> rather than <%= %> (thanks Jon Frisby). Fixed defect in multipart form and stylesheet_link directives (thanks Rajavel Lenin). Made REXML sax2parser configurable. Generator now creates example for custom admin auth mixin controlling authentication with custom code. (thanks David Koontz) Fix defect which prevented MasterView to be used with Goldberg or other plugins which alter the view base unless MasterView was configured to generate the rhtml files. Fix rails runtime detection when running in RadRails which launches using -e Added rake task mv:clean_mv_rhtml task which removes the MasterView generated rhtml if you have configured MasterView to generate to the file system. Only removes files that it generates leaving other rhtml untouched. This is useful when switching to not generating rhtml mode when it was previously enabled. == Release 0.3.2 - Maintenance release plus custom admin auth This release addresses a compatibility problem with Rails 1.2 where a view syntax error would not display the normal debug output but instead displayed only a blank screen. Also fixed a parsing problem with multiple parameters in some directives. Added the ability to use custom mixin for authorization to MasterView admin screens. Changed the MasterView generator to use request, flash, and params rather than deprecated @request, @flash, and @params. Tested with Rails 1.2.2 == Details Author:: Jeff Barczewski Email:: jeff.barczewski (at) gmail (dot) com Primary developers:: Jeff Barczewski, Deb Lewis Website:: http://masterview.org Rubyforge project:: masterview (http://rubyforge.org/projects/masterview) License:: MIT open source license like Rails === Video === A short video demonstrating use of MasterView converting an HTML prototype into a live application while still allowing round trip WYSIWYG editing. http://masterview.org/media/html-to-live/screencast.html === Screenshots, illustrations, other video === http://masterview.org/media_list.html === Packaging === 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. == 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 adding masterview directives markup to an (x)html ptototype, or can be 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. == Next Steps Visit the online documentation page at http://masterview.org/ for screenshots, illustrations, complete installation and usage information. We would love to hear your feedback and ideas around this project! Visit the rubyforge project to join the users mailing list or to add yourself to the announce list to receive future announcements. Check out the video to see MasterView in action! Thanks for your time!! MasterView Development Team Jeff Barczewski and Deb Lewis From jeff.barczewski at gmail.com Wed Oct 10 13:03:39 2007 From: jeff.barczewski at gmail.com (Jeff Barczewski) Date: Wed, 10 Oct 2007 12:03:39 -0500 Subject: [Masterview-users] Masterview issues In-Reply-To: <470C3AD0.8000103@advancedsl.com.ar> References: <470C3AD0.8000103@advancedsl.com.ar> Message-ID: <19cda190710101003x3c344873ree7ad798d81c668@mail.gmail.com> Gonzalo, See my embedded responses. Blessings, Jeff On 10/9/07, Gonzalo Garramu?o wrote: > > Sorry to send you this, but I am having problems posting to rubyforge's > mailing list, albeit I am subscribed. No problem. I have a project I am now developing with masterview and I run into a > problem right away. > > 1) Basically, the issue I have is that: > > script/generate masterview MyModel > > generates empty .html files for some models. Funny enough, I can verify > masterview works, as it generates proper views for one of my models, but > not the others. > The database tables are called videos (works), audios and images (don't > work). > > Needless to say, using: > > script/generate scaffold Audio > > works fine. I'd be glad to take a look if you want to tar/gz up the project and send to me so I can see what is going on. Please include the migrations or schema.rbso I can recreate the db. 2) mv:image_tag or mv:content should support Ruby's quoting rules (or if > they do, they need examples in the manual). In my database, I wanted to > display a picture associated with each image. > > Currently, the only way I could make it work was with this: > > image Thumbnail You could also write it as so image Thumbnail using ruby's %{} to create a string with substitution enabled > -- > Gonzalo Garramu?o > -- Jeff Barczewski, MasterView core team Inspired Horizons Ruby on Rails Training and Consultancy http://inspiredhorizons.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-users/attachments/20071010/521aeceb/attachment-0001.html From jeff.barczewski at gmail.com Thu Oct 11 14:55:43 2007 From: jeff.barczewski at gmail.com (Jeff Barczewski) Date: Thu, 11 Oct 2007 13:55:43 -0500 Subject: [Masterview-users] Masterview generator issue with boolean (or time fields) Message-ID: <19cda190710111155v3fc512e8h17cffca5eaf934d5@mail.gmail.com> On 10/9/07, Gonzalo Garramu?o wrote: > > > I have a project I am now developing with masterview and I run into a > problem right away. > > 1) Basically, the issue I have is that: > > script/generate masterview MyModel > > generates empty .html files for some models. Funny enough, I can verify > masterview works, as it generates proper views for one of my models, but > not the others. > The database tables are called videos (works), audios and images (don't > work). > > Needless to say, using: > > script/generate scaffold Audio > > works fine. Gonzalo, After looking into the masterview generator issue with your table, it turns out the problem was that we did not implement a generate method for boolean fields which your Audio table had. I also noticed that we didn't have a method for time fields. So I have added a boolean and time_select generate methods to the generator which fixed the problem. I have checked the code into the trunk. So would you mind installing the latest code from the trunk and test to see if this fixes your problems. You can do this by going to your railsapp directory and executing script/plugin install svn://rubyforge.org/var/svn/masterview/trunk/masterview If this indeed fixes your problem then it will become part of the next release (0.3.5). Let me know if this resolves things for you or causes you any other problems. Thanks, Jeff -- Jeff Barczewski, MasterView core team Inspired Horizons Ruby on Rails Training and Consultancy http://inspiredhorizons.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-users/attachments/20071011/1e303a54/attachment.html From gga at filmaura.com Thu Oct 11 18:51:59 2007 From: gga at filmaura.com (Gonzalo Garramuno) Date: Thu, 11 Oct 2007 19:51:59 -0300 Subject: [Masterview-users] Masterview generator issue with boolean (or time fields) In-Reply-To: <19cda190710111155v3fc512e8h17cffca5eaf934d5@mail.gmail.com> References: <19cda190710111155v3fc512e8h17cffca5eaf934d5@mail.gmail.com> Message-ID: <470EA90F.1070707@filmaura.com> Jeff Barczewski wrote: > > Let me know if this resolves things for you or causes you any other > problems. Seems to work properly now. Small question: I had installed masterview as a gem to get automatic updates. Now that I got it from svn, will gem update still work properly? -- Gonzalo Garramu?o Film Aura A New Dawn in Media Companies gga at filmaura.com http://www.filmaura.com From gga at filmaura.com Thu Oct 11 19:15:09 2007 From: gga at filmaura.com (Gonzalo Garramuno) Date: Thu, 11 Oct 2007 20:15:09 -0300 Subject: [Masterview-users] Masterview generator issue with boolean (or time fields) In-Reply-To: <470EA90F.1070707@filmaura.com> References: <19cda190710111155v3fc512e8h17cffca5eaf934d5@mail.gmail.com> <470EA90F.1070707@filmaura.com> Message-ID: <470EAE7D.2020308@filmaura.com> Gonzalo Garramuno wrote: > Seems to work properly now. Maybe I spoke too fast. Do: script/generate masterview Show Then go to the show/new form. The two date fields will show incorrectly tabulated. There may be some being handled wrong in there. -- Gonzalo Garramu?o Film Aura A New Dawn in Media Companies gga at filmaura.com http://www.filmaura.com From gga at filmaura.com Thu Oct 11 19:26:37 2007 From: gga at filmaura.com (Gonzalo Garramuno) Date: Thu, 11 Oct 2007 20:26:37 -0300 Subject: [Masterview-users] Bad handling of multi word tables in templates Message-ID: <470EB12D.9000100@filmaura.com> Minor template generation issues does not follow rails conventions. With my project, do: > script/generate masterview PixelFormat You will get a list.html and similar pages that have: Header: "PixelFormat" (without a space) Content: "Pixel_formats" (with an underscore and lowercase) Menu: "Create new pixel_format" (an underscore and lowercase) All those three are wrong. -- Gonzalo Garramu?o Film Aura A New Dawn in Media Companies gga at filmaura.com http://www.filmaura.com From jeff.barczewski at gmail.com Mon Oct 15 23:11:34 2007 From: jeff.barczewski at gmail.com (Jeff Barczewski) Date: Mon, 15 Oct 2007 22:11:34 -0500 Subject: [Masterview-users] Masterview generator issue with boolean (or time fields) In-Reply-To: <470EAE7D.2020308@filmaura.com> References: <19cda190710111155v3fc512e8h17cffca5eaf934d5@mail.gmail.com> <470EA90F.1070707@filmaura.com> <470EAE7D.2020308@filmaura.com> Message-ID: <19cda190710152011n5f6c951aq4db7ba68893f0027@mail.gmail.com> Sorry didn't get back to you sooner, I've been traveling and will be getting back home Wednesday, so I'll take a look then. Jeff On 10/11/07, Gonzalo Garramuno wrote: > > Gonzalo Garramuno wrote: > > Seems to work properly now. > Maybe I spoke too fast. Do: > > script/generate masterview Show > > Then go to the show/new form. The two date fields will show incorrectly > tabulated. There may be some being handled wrong in there. > > -- > Gonzalo Garramu?o > > Film Aura > A New Dawn in Media Companies > > gga at filmaura.com > http://www.filmaura.com > > _______________________________________________ > Masterview-users mailing list > Masterview-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/masterview-users > -- Jeff Barczewski, MasterView core team Inspired Horizons Ruby on Rails Training and Consultancy http://inspiredhorizons.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-users/attachments/20071015/3a601475/attachment.html From jeff.barczewski at gmail.com Mon Oct 15 23:15:52 2007 From: jeff.barczewski at gmail.com (Jeff Barczewski) Date: Mon, 15 Oct 2007 22:15:52 -0500 Subject: [Masterview-users] switching back to using gems rather than plugin Message-ID: <19cda190710152015x7458e883k1ea230fd6619a045@mail.gmail.com> If you do a script/plugin install of masterview and later want to go back to using gems, see my message below ---------- Forwarded message ---------- From: Jeff Barczewski Date: Oct 15, 2007 10:13 PM Subject: Re: Masterview generator issue with boolean (or time fields) To: Gonzalo Garramu?o Once, we release the new gem you can delete the vendor/plugins/masterview directory and run script/generate masterview_plugin again to make it use gems once again otherwise it will use what is in the plugin directory first. Jeff On 10/11/07, Gonzalo Garramu?o wrote: > > Jeff Barczewski wrote: > > > > Let me know if this resolves things for you or causes you any other > > problems. > > > Seems to work properly now. Small question: > > I had installed masterview as a gem to get automatic updates. Now that > I got it from svn, will gem update still work properly? > > > -- > Gonzalo Garramu?o > ggarra at advancedsl.com.ar > > AMD4400 - ASUS48N-E > GeForce7300GT > Kubuntu Edgy > -- Jeff Barczewski, MasterView core team Inspired Horizons Ruby on Rails Training and Consultancy http://inspiredhorizons.com/ -- Jeff Barczewski, MasterView core team Inspired Horizons Ruby on Rails Training and Consultancy http://inspiredhorizons.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-users/attachments/20071015/54cc9e38/attachment.html From gga at filmaura.com Tue Oct 16 04:19:09 2007 From: gga at filmaura.com (Gonzalo Garramuno) Date: Tue, 16 Oct 2007 05:19:09 -0300 Subject: [Masterview-users] Some comments on masterview Message-ID: <471473FD.9020300@filmaura.com> After trying masterview for a week, I've gone back to using plain rails .rhtml files. The reasons or problems I found with masterview were: a) Extremely slow updates sometimes. I'm on an AMD4400 Dual and sometimes some refreshes would take like 10 seconds in development mode, compared to the 2-3 seconds with .rhtml files. b) Updates would not happen and the only reason you'd know is by having to switch to the admin page to see what went wrong. Rails already has a notice mechanism. Why not use it when a page cannot be created due to some syntax or other conflict? c) Lack of use of layouts. Masterview uses some main page for the layout page, and I found that to be extremely counter productive. For one, I could never remember which one was it. And any change on it also often lead to out-of-sync issues, forcing you again another visit to the admin page. I found those issues to be killer features and realized that masterview ended up not helping me but slowing me down. -- Gonzalo Garramu?o Film Aura A New Dawn in Media Companies gga at filmaura.com http://www.filmaura.com From djlewis at acm.org Tue Oct 16 14:35:20 2007 From: djlewis at acm.org (Deb Lewis) Date: Tue, 16 Oct 2007 11:35:20 -0700 Subject: [Masterview-users] Some comments on masterview In-Reply-To: <471473FD.9020300@filmaura.com> References: <471473FD.9020300@filmaura.com> Message-ID: <20071016113520519008.0c6c562b@acm.org> Gonzalo - thanks for the feedback, it's useful (tho your negative conclusion is regrettable) RE: page cannot be created due to some syntax error oops, that's a problem I've been meaning to fix for months and haven't gotten to; I'll get that fixed because it's incredibly baffling if you have a typo or syntax error that fails strict xml parsing of the xhtml. Workaround: there's a config option to run tidy on the front-end of masterview's template processing, that tends to patch up dopey mistakes as well as sloppy html markup. http://masterview.org/configuration.html#mv_template_parsing_options RE: lack of use of layouts and MV use of main page which can get out of sync This gets into an area of different ways you can use masterview templates (and isn't really discussed at all in our documentation). All the examples and Jeff's samples show using a master main page, but it turns out that's not the only technique. I actually use MasterView templates solely for the content pages of my site, with standard rails layouts used in the site rendering in the normal fashion. This means that when I'm editing my content pages at development I don't see the site framing that the rails layouts add (headers, nav sidebars, etc) provide if I'm using a WYSIWYG editor or checking the page directly in a browser, but for me that's an acceptable degree of development-time fidelity. I want the content of my pages to edit and render with reasonable fidelity at edit time, so I wrap a standard little boilerplate html page around content chunks to hook up ref to stylesheet (sample below), but I don't use the mv:import facility that would show the full layout at design time. This gives me the attribute markup notation I want for the dynamic aspects in my content pages, but doesn't introduce syncing problems of trying to keep content pages updated if I change the layout. ~ Deb ... boilerplate title + link to my stylesheet...
... page content to pour into layout slot (html, mv directives, etc)
From djlewis at acm.org Tue Oct 16 14:35:20 2007 From: djlewis at acm.org (Deb Lewis) Date: Tue, 16 Oct 2007 11:35:20 -0700 Subject: [Masterview-users] Some comments on masterview In-Reply-To: <471473FD.9020300@filmaura.com> References: <471473FD.9020300@filmaura.com> Message-ID: <20071016113520519008.0c6c562b@acm.org> Gonzalo - thanks for the feedback, it's useful (tho your negative conclusion is regrettable) RE: page cannot be created due to some syntax error oops, that's a problem I've been meaning to fix for months and haven't gotten to; I'll get that fixed because it's incredibly baffling if you have a typo or syntax error that fails strict xml parsing of the xhtml. Workaround: there's a config option to run tidy on the front-end of masterview's template processing, that tends to patch up dopey mistakes as well as sloppy html markup. http://masterview.org/configuration.html#mv_template_parsing_options RE: lack of use of layouts and MV use of main page which can get out of sync This gets into an area of different ways you can use masterview templates (and isn't really discussed at all in our documentation). All the examples and Jeff's samples show using a master main page, but it turns out that's not the only technique. I actually use MasterView templates solely for the content pages of my site, with standard rails layouts used in the site rendering in the normal fashion. This means that when I'm editing my content pages at development I don't see the site framing that the rails layouts add (headers, nav sidebars, etc) provide if I'm using a WYSIWYG editor or checking the page directly in a browser, but for me that's an acceptable degree of development-time fidelity. I want the content of my pages to edit and render with reasonable fidelity at edit time, so I wrap a standard little boilerplate html page around content chunks to hook up ref to stylesheet (sample below), but I don't use the mv:import facility that would show the full layout at design time. This gives me the attribute markup notation I want for the dynamic aspects in my content pages, but doesn't introduce syncing problems of trying to keep content pages updated if I change the layout. ~ Deb ... boilerplate title + link to my stylesheet...
... page content to pour into layout slot (html, mv directives, etc)
From djlewis at acm.org Tue Oct 16 14:35:20 2007 From: djlewis at acm.org (Deb Lewis) Date: Tue, 16 Oct 2007 11:35:20 -0700 Subject: [Masterview-users] Some comments on masterview In-Reply-To: <471473FD.9020300@filmaura.com> References: <471473FD.9020300@filmaura.com> Message-ID: <20071016113520519008.0c6c562b@acm.org> Gonzalo - thanks for the feedback, it's useful (tho your negative conclusion is regrettable) RE: page cannot be created due to some syntax error oops, that's a problem I've been meaning to fix for months and haven't gotten to; I'll get that fixed because it's incredibly baffling if you have a typo or syntax error that fails strict xml parsing of the xhtml. Workaround: there's a config option to run tidy on the front-end of masterview's template processing, that tends to patch up dopey mistakes as well as sloppy html markup. http://masterview.org/configuration.html#mv_template_parsing_options RE: lack of use of layouts and MV use of main page which can get out of sync This gets into an area of different ways you can use masterview templates (and isn't really discussed at all in our documentation). All the examples and Jeff's samples show using a master main page, but it turns out that's not the only technique. I actually use MasterView templates solely for the content pages of my site, with standard rails layouts used in the site rendering in the normal fashion. This means that when I'm editing my content pages at development I don't see the site framing that the rails layouts add (headers, nav sidebars, etc) provide if I'm using a WYSIWYG editor or checking the page directly in a browser, but for me that's an acceptable degree of development-time fidelity. I want the content of my pages to edit and render with reasonable fidelity at edit time, so I wrap a standard little boilerplate html page around content chunks to hook up ref to stylesheet (sample below), but I don't use the mv:import facility that would show the full layout at design time. This gives me the attribute markup notation I want for the dynamic aspects in my content pages, but doesn't introduce syncing problems of trying to keep content pages updated if I change the layout. ~ Deb ... boilerplate title + link to my stylesheet...
... page content to pour into layout slot (html, mv directives, etc)
From mortee.lists at kavemalna.hu Fri Oct 19 07:23:07 2007 From: mortee.lists at kavemalna.hu (mortee) Date: Fri, 19 Oct 2007 13:23:07 +0200 Subject: [Masterview-users] using mv stand-alone Message-ID: <4718939B.2000407@kavemalna.hu> Hi, On the configuration page of the MV website, there's a mention about that it can be used stand-alone, outside of Rails. The page only mentions a short configuration example however, and there's no explanation how it can actually be used to produce pages. I want to simply generate html files out of a database. Could anyone help me with this? thx mortee From djlewis at acm.org Sun Oct 21 02:49:40 2007 From: djlewis at acm.org (Deb Lewis) Date: Sat, 20 Oct 2007 23:49:40 -0700 Subject: [Masterview-users] using mv stand-alone In-Reply-To: <4718939B.2000407@kavemalna.hu> References: <4718939B.2000407@kavemalna.hu> Message-ID: <20071020234940064731.497f40b5@acm.org> Mortee - I'm probably going to be experimenting with this sort of thing over the next week or two, I'll see what I can pull together to help explain this scenario and provide some examples. There are config options and rake tasks for generating rhtml files into the file systesm from masterview markup temmplates but that may not quite solve your problem if you're trying to get to fully-generated html by evaluating erb in the rhtml. You might have to explain a bit more about what you'd like to do. ~ Deb On Fri, 19 Oct 2007 13:23:07 +0200, mortee wrote: > > Hi, > > On the configuration page of the MV website, there's a mention about > that it can be used stand-alone, outside of Rails. The page only > mentions a short configuration example however, and there's no > explanation how it can actually be used to produce pages. > > I want to simply generate html files out of a database. Could anyone > help me with this? > > thx > mortee From djlewis at acm.org Sun Oct 21 02:49:40 2007 From: djlewis at acm.org (Deb Lewis) Date: Sat, 20 Oct 2007 23:49:40 -0700 Subject: [Masterview-users] using mv stand-alone In-Reply-To: <4718939B.2000407@kavemalna.hu> References: <4718939B.2000407@kavemalna.hu> Message-ID: <20071020234940064731.497f40b5@acm.org> Mortee - I'm probably going to be experimenting with this sort of thing over the next week or two, I'll see what I can pull together to help explain this scenario and provide some examples. There are config options and rake tasks for generating rhtml files into the file systesm from masterview markup temmplates but that may not quite solve your problem if you're trying to get to fully-generated html by evaluating erb in the rhtml. You might have to explain a bit more about what you'd like to do. ~ Deb On Fri, 19 Oct 2007 13:23:07 +0200, mortee wrote: > > Hi, > > On the configuration page of the MV website, there's a mention about > that it can be used stand-alone, outside of Rails. The page only > mentions a short configuration example however, and there's no > explanation how it can actually be used to produce pages. > > I want to simply generate html files out of a database. Could anyone > help me with this? > > thx > mortee From mortee.lists at kavemalna.hu Sun Oct 21 21:10:33 2007 From: mortee.lists at kavemalna.hu (mortee) Date: Mon, 22 Oct 2007 03:10:33 +0200 Subject: [Masterview-users] using mv stand-alone In-Reply-To: <20071020234940064731.497f40b5@acm.org> References: <4718939B.2000407@kavemalna.hu> <20071020234940064731.497f40b5@acm.org> Message-ID: <471BF889.6080703@kavemalna.hu> Deb Lewis wrote: > Mortee - I'm probably going to be experimenting with this sort of thing > over the next week or two, I'll see what I can pull together to help > explain this scenario and provide some examples. Great! > There are config options and rake tasks for generating rhtml files into > the file systesm from masterview markup temmplates but that may not > quite solve your problem if you're trying to get to fully-generated > html by evaluating erb in the rhtml. You might have to explain a bit > more about what you'd like to do. Currently I'm using pure ERB to generate a static website out of a database. I'm trying to make the whole thing more Rails-like so that I can change to it easier later, when conditions let me do so. I guess we could benefit from MV within our current constraints if it can be used to produce pages without a real Rails environment. mortee From jeff.barczewski at gmail.com Mon Oct 22 12:28:43 2007 From: jeff.barczewski at gmail.com (Jeff Barczewski) Date: Mon, 22 Oct 2007 11:28:43 -0500 Subject: [Masterview-users] Some comments on masterview In-Reply-To: <471473FD.9020300@filmaura.com> References: <471473FD.9020300@filmaura.com> Message-ID: <19cda190710220928g32d4c060o12dc4671c8942113@mail.gmail.com> On 10/16/07, Gonzalo Garramuno wrote: > > > After trying masterview for a week, I've gone back to using plain rails > .rhtml files. Sorry that it didn't prove to be a success for you. The big win is for people who work with designers that want to manipulate their pages in a WYSIWYG tool like Dreamweaver or NVU. The fact that they work with it directly in their editor, update the pages, save it and have it quickly be available to users (roundtripping through out life cycle of project) is the main feature over other templating techniques. If .rhtml works best for you, then go with that. Everyone's needs are different. I appreciate you taking the time to mention things we can improve though, that will help as we continue to refine the project. The reasons or problems I found with masterview were: > > a) Extremely slow updates sometimes. I'm on an AMD4400 Dual and > sometimes some refreshes would take like 10 seconds in development mode, > compared to the 2-3 seconds with .rhtml files. I haven't seen anywhere near that sort of delay on my machines many of which are less powerful than that, but there would have to be some delay in a refresh if you have changed files, since it has to parse and generate rhtml before the actual rhtml is used, thus there will be some overhead, but only when things have changed and new rhtml needs to be generated. Also just to clarify for future readers, the extra overhead is only when regenerating rhtml files, after they are regenerated and cached, system should perform identically to rhtml only site. It's also recommended for production to have MasterView generate the rhtml to the file system to save memory and one can even deploy the rhtml to a production server without even having MasterView installed, it isn't needed once the rhtml is generated. > b) Updates would not happen and the only reason you'd know is by having > to switch to the admin page to see what went wrong. Rails already has a > notice mechanism. Why not use it when a page cannot be created due to > some syntax or other conflict? As Deb confirmed, we are looking at better error detection and reporting. c) Lack of use of layouts. Masterview uses some main page for the > layout page, and I found that to be extremely counter productive. For > one, I could never remember which one was it. And any change on it also > often lead to out-of-sync issues, forcing you again another visit to the > admin page. Just to clarify for other readers, MasterView can use (and generate) layouts, but the issue Gonzalo is referring to is the fact that when you are having MasterView generate a layout, one file will be generating the layout and the other files are importing the layout. The importing into the other pages is so that you can get a true WYSIWYG view of all of your pages, not just pieces. So if a layout changes, you have to click rebuild outdated files from admin screen or use a rake task to do this. We did not want to make this part automatic, to make sure that you deliberately wanted to do this and only the developer would know when is a good time to do the rebuild (in case they were editing files). As Deb mentioned, there are many ways to organize your files, we typically put the layout in with the list template (which is typically the default view), but one could organize in many other ways including just naming a view as something_layout.html and then having all the other views import it. Also note that rebuilding the html templates is only necessary if you want the changes to the layout to appear in your other files when using them in a WYSIWYG editor, you do not need to rebuild in order for the changes to be used across all the views at runtime. So rebuild is only needed so that designer's templates are in sync, if you don't care about that then you can skip rebuilding altogether or do it whenever it is convenient. We are also going to research if we might be able to leverage Dreamweaver's abilities for rebuilding layout used across pages. Thanks for taking the time to document your troubles, it will help us improve the project for others. I wish you all the best in your endeavors. Blessings, Jeff -- Jeff Barczewski, MasterView core team Inspired Horizons Ruby on Rails Training and Consultancy http://inspiredhorizons.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-users/attachments/20071022/4ad5025f/attachment-0001.html From reggeli at kavemalna.hu Sun Oct 21 15:58:47 2007 From: reggeli at kavemalna.hu (Marton Fabo) Date: Sun, 21 Oct 2007 21:58:47 +0200 Subject: [Masterview-users] using mv stand-alone In-Reply-To: <20071020234940064731.497f40b5@acm.org> References: <4718939B.2000407@kavemalna.hu> <20071020234940064731.497f40b5@acm.org> Message-ID: <471BAF77.8020309@kavemalna.hu> Deb Lewis wrote: > Mortee - I'm probably going to be experimenting with this sort of thing > over the next week or two, I'll see what I can pull together to help > explain this scenario and provide some examples. Great! > There are config options and rake tasks for generating rhtml files into > the file systesm from masterview markup temmplates but that may not > quite solve your problem if you're trying to get to fully-generated > html by evaluating erb in the rhtml. You might have to explain a bit > more about what you'd like to do. Currently I'm using pure ERB to generate a static website out of a database. I'm trying to make the whole thing more Rails-like so that I can change to it easier later, when conditions let me do so. I guess we could benefit from MV within our current constraints if it can be used to produce pages without a real Rails environment. mortee -- The two basic principles of Windows system administration: * For minor problems, reboot * For major problems, reinstall From jeff.barczewski at gmail.com Mon Oct 22 12:45:29 2007 From: jeff.barczewski at gmail.com (Jeff Barczewski) Date: Mon, 22 Oct 2007 11:45:29 -0500 Subject: [Masterview-users] using mv stand-alone In-Reply-To: <4718939B.2000407@kavemalna.hu> References: <4718939B.2000407@kavemalna.hu> Message-ID: <19cda190710220945i5715a65bn1d1ff3f1a274bfcf@mail.gmail.com> On 10/19/07, mortee wrote: > > > Hi, > > On the configuration page of the MV website, there's a mention about > that it can be used stand-alone, outside of Rails. The page only > mentions a short configuration example however, and there's no > explanation how it can actually be used to produce pages. > Mortee, Yes, MasterView can be used outside of Rails but we need to document more about how to do this. Maybe Deb's notes on this will help some. Eventually, I would like to document and implement additional features to allow MasterView that would make it a good tool for other web frameworks beyond Rails, like MERB, Nitro, ramaze, etc. We can bring the power of MasterView to each of these environments without needing to change much in the codebase. Once Deb has a chance to post some notes, if you have any additional questions, feel free to post them here on the mailing list and we'll do our best to help. Blessings, Jeff -- Jeff Barczewski, MasterView core team Inspired Horizons Ruby on Rails Training and Consultancy http://inspiredhorizons.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-users/attachments/20071022/30038e0a/attachment.html From mortee.lists at kavemalna.hu Fri Oct 26 12:34:12 2007 From: mortee.lists at kavemalna.hu (mortee) Date: Fri, 26 Oct 2007 18:34:12 +0200 Subject: [Masterview-users] using mv stand-alone In-Reply-To: <20071020234940064731.497f40b5@acm.org> References: <4718939B.2000407@kavemalna.hu> <20071020234940064731.497f40b5@acm.org> Message-ID: <47221704.2080102@kavemalna.hu> Deb Lewis wrote: > Mortee - I'm probably going to be experimenting with this sort of thing > over the next week or two, I'll see what I can pull together to help > explain this scenario and provide some examples. I'm just posting to have this group appear in gmane at last (: While at it: any progress worth mention with this issue? regards mortee From djlewis at acm.org Fri Oct 26 16:58:06 2007 From: djlewis at acm.org (Deb Lewis) Date: Fri, 26 Oct 2007 13:58:06 -0700 Subject: [Masterview-users] using mv stand-alone In-Reply-To: <47221704.2080102@kavemalna.hu> References: <4718939B.2000407@kavemalna.hu> <20071020234940064731.497f40b5@acm.org> <47221704.2080102@kavemalna.hu> Message-ID: <20071026135806420781.8a03efc6@acm.org> Not yet, sorry. It's actually high prio, I have some sites I need to do some work along these lines for, but I live in southern California and everything on my schedule this past week has pretty much been shut down due to distractions etc from the fires in our area. (we were lucky, many others were not) ~ Deb On Fri, 26 Oct 2007 18:34:12 +0200, mortee wrote: > Deb Lewis wrote: >> Mortee - I'm probably going to be experimenting with this sort of thing >> over the next week or two, I'll see what I can pull together to help >> explain this scenario and provide some examples. > > I'm just posting to have this group appear in gmane at last (: > > While at it: any progress worth mention with this issue? > > regards > mortee From djlewis at acm.org Fri Oct 26 16:58:06 2007 From: djlewis at acm.org (Deb Lewis) Date: Fri, 26 Oct 2007 13:58:06 -0700 Subject: [Masterview-users] using mv stand-alone In-Reply-To: <47221704.2080102@kavemalna.hu> References: <4718939B.2000407@kavemalna.hu> <20071020234940064731.497f40b5@acm.org> <47221704.2080102@kavemalna.hu> Message-ID: <20071026135806420781.8a03efc6@acm.org> Not yet, sorry. It's actually high prio, I have some sites I need to do some work along these lines for, but I live in southern California and everything on my schedule this past week has pretty much been shut down due to distractions etc from the fires in our area. (we were lucky, many others were not) ~ Deb On Fri, 26 Oct 2007 18:34:12 +0200, mortee wrote: > Deb Lewis wrote: >> Mortee - I'm probably going to be experimenting with this sort of thing >> over the next week or two, I'll see what I can pull together to help >> explain this scenario and provide some examples. > > I'm just posting to have this group appear in gmane at last (: > > While at it: any progress worth mention with this issue? > > regards > mortee From nico.ritsche at googlemail.com Fri Oct 26 18:45:29 2007 From: nico.ritsche at googlemail.com (Nico Ritsche) Date: Fri, 26 Oct 2007 23:45:29 +0100 Subject: [Masterview-users] conditional styling of html elements whithout element duplication Message-ID: Hi, first of all I think MasterView is a very useful tool. Good work! I'm struggling to get the following working: I have a menu consisting of several links. Dependent on the current controller action, the according menu link should be styled differently than the other links. My current solution is to do this for each menu option:
  • Home Home
  • .. .. However, this doesn't work very nicely, as the static html shows each menu option twice. Also it seems a bit awkward. Another idea I had is to use something like this:
  • Home
  • This doesn't compile as the erb #{ if @selected == 'home' 'selected' else 'not_selected' end } isn't correct, I could use erb directly I guess, like this {{{ if @selected == 'home' }}}
  • ...
  • {{{ else }}}
  • ...
  • {{{ end }}} But than I have the double links again. Is there a good way of achieving what I want? Conditional styling of page elements while keeping only one alternative in the static html seems quite an essential thing to me. Anyway, I'm new to rails and MasterView, so I might have overlooked some more obvious solution. Nico -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-users/attachments/20071026/115ef470/attachment.html From djlewis at acm.org Mon Oct 29 12:57:30 2007 From: djlewis at acm.org (Deb Lewis) Date: Mon, 29 Oct 2007 09:57:30 -0700 Subject: [Masterview-users] conditional styling of html elements whithout element duplication In-Reply-To: References: Message-ID: <20071029095730994322.da023113@acm.org> Nico, >> doesn't compile as the erb #{ if @selected == 'home' 'selected' else 'not_selected' end } isn't correct If you want to write that sort of expression, use the ruby ternary operator - it's more concise and clearer: condition ? if_true : if_false So your markup idea:
  • ...link...
  • would be:
  • ...link...
  • Similar technique could be used with your first markup approach, where you applied styling on the link label rather than on the containing
  • element holding the nav link - use the ternary operation notation
  • {{{= (@current_page == 'home' ? 'Home : 'Home' }}}
  • or perhaps avoid repeating the actual label by conditional subst:
  • {{{= (@current_page == 'home' ? '%s : '%s') %'Home' }}}
  • Next step would be to simplify the template markup. A good technique would be to encapsulate the whole notion of "is the page [action] which is the target of this nav link the current view?" as a method in your controller class, rather than bolting your views down to inst var refs and explicit dependence on the controller implementation. Do something like defining a predicate method isCurrentPage which takes the page/action name as arg:
  • ...
  • This is still rather repetitous markup, as each link in your nav area would need this expression, but if you only have to define the nav feature once (say, in a layout) that's probably acceptable. If you have to write this sort of expression in a lot of places a custom masterview directive can be a good solution. Creating your own directive for emitting the markup for a linkn would let you customize the attribute markup so your templates have a simpler notation to express the desired link, with the details of styling and the link reference handled in one place in the directive implementation. ~ Deb From djlewis at acm.org Mon Oct 29 12:57:30 2007 From: djlewis at acm.org (Deb Lewis) Date: Mon, 29 Oct 2007 09:57:30 -0700 Subject: [Masterview-users] conditional styling of html elements whithout element duplication In-Reply-To: References: Message-ID: <20071029095730994322.da023113@acm.org> Nico, >> doesn't compile as the erb #{ if @selected == 'home' 'selected' else 'not_selected' end } isn't correct If you want to write that sort of expression, use the ruby ternary operator - it's more concise and clearer: condition ? if_true : if_false So your markup idea:
  • ...link...
  • would be:
  • ...link...
  • Similar technique could be used with your first markup approach, where you applied styling on the link label rather than on the containing
  • element holding the nav link - use the ternary operation notation
  • {{{= (@current_page == 'home' ? 'Home : 'Home' }}}
  • or perhaps avoid repeating the actual label by conditional subst:
  • {{{= (@current_page == 'home' ? '%s : '%s') %'Home' }}}
  • Next step would be to simplify the template markup. A good technique would be to encapsulate the whole notion of "is the page [action] which is the target of this nav link the current view?" as a method in your controller class, rather than bolting your views down to inst var refs and explicit dependence on the controller implementation. Do something like defining a predicate method isCurrentPage which takes the page/action name as arg:
  • ...
  • This is still rather repetitous markup, as each link in your nav area would need this expression, but if you only have to define the nav feature once (say, in a layout) that's probably acceptable. If you have to write this sort of expression in a lot of places a custom masterview directive can be a good solution. Creating your own directive for emitting the markup for a linkn would let you customize the attribute markup so your templates have a simpler notation to express the desired link, with the details of styling and the link reference handled in one place in the directive implementation. ~ Deb From nico.ritsche at googlemail.com Fri Oct 26 18:41:29 2007 From: nico.ritsche at googlemail.com (Nico Ritsche) Date: Fri, 26 Oct 2007 23:41:29 +0100 Subject: [Masterview-users] conditional styling of html elements whithout element duplication Message-ID: Hi, first of all I think MasterView is a very useful tool. Good work! I'm struggling to get the following working: I have a menu consisting of several links. Dependent on the current controller action, the according menu link should be styled differently than the other links. My current solution is to do this for each menu option:
  • Home Home
  • .. .. However, this doesn't work very nicely, as the static html shows each menu option twice. Also it seems a bit awkward. Another idea I had is to use something like this:
  • Home
  • This doesn't compile as the erb #{ if @selected == 'home' 'selected' else 'not_selected' end } isn't correct, I could use erb directly I guess, like this {{{ if @selected == 'home' }}}
  • ...
  • {{{ else }}}
  • ...
  • {{{ end }}} But than I have the double links again. Is there a good way of achieving what I want? Conditional styling of page elements while keeping only one alternative in the static html seems quite an essential thing to me. Anyway, I'm new to rails and MasterView, so I might have overlooked some more obvious solution. Nico -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-users/attachments/20071026/8fd0cf5d/attachment.html From nico.ritsche at googlemail.com Mon Oct 29 19:11:48 2007 From: nico.ritsche at googlemail.com (Nico Ritsche) Date: Mon, 29 Oct 2007 23:11:48 +0000 Subject: [Masterview-users] conditional styling of html elements Message-ID: Hi Deb, thanks for your answer! I got this working now:
  • Home
  • However, I couldn't get your other idea working:
  • {{{= controller.controller_name == 'home' ? 'Home' : 'Home' }}}
  • This doesn't compile. Also, if I this was working, the static html would be wrong, as the Link text "Home" would be missing, right? So I would have to include a dummy element. However, I don't now how to get that working either: I tried to format the "Home" menu option using the selected class in the static html page, just to get an idea of how a selected menu will look like. I tried this:
  • Home
  • But it doesn't compile. My guess is there is a conflict with the mv:link_to directive which just expects a string, not a string with another nested mv directive. Anyway, I'm already quite happy with my current solution, thanks. Something else I noticed: Why does masterview change the formatting of my html? For instance becomes lang="en" mv:import="layouts/admin.rhtml" xml:lang="en" xmlns=" http://www.w3.org/1999/xhtml"> so the linebreak is ignored. I think I saw such more or less sutbtle changes in other places as well. But I can't remember where right now. I think tabs were ignored. I'd prefer the formatting not beeing touched by masterview. Kind Regards, Nico -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-users/attachments/20071029/ce2dd927/attachment.html From djlewis at acm.org Wed Oct 31 15:20:58 2007 From: djlewis at acm.org (Deb Lewis) Date: Wed, 31 Oct 2007 12:20:58 -0700 Subject: [Masterview-users] conditional styling of html elements In-Reply-To: References: Message-ID: <20071031122058829124.12a4a90b@acm.org> Nico - I'll follow up on the alt versions of your scenario when I have a chance to set up a test site to play with some of this, but glad to hear you've got a workable solution for now for your nav link highlighting (even if not necessarily prettiest/most ideal notation). > > Something else I noticed: > > Why does masterview change the formatting of my html? > [... snip... example of line break changing in DOCTYPE decl...] > > I think I saw such more or less sutbtle changes in other places as well. But > I can't remember where right now. I think tabs were ignored. > I'd prefer the formatting not beeing touched by masterview. > That turns out to pretty fundamental (and I think fairly typical of this sort of template processing). We necessarily have potentially non-trivial changes in the text between the template and the processed output and masterview makes no attempt to preserve the original formatting. I think that's a good design decision, it would be difficult to do accurately and in practice I just don't think it's a problem worth solving. So the short answer is "tough, deal with it"! The nicer response is that you need to let go of that attachment to your source formatting. (As did I, in fact). The masterview output is a generated artifact, it's *not* the master source and it's not the text that you work on when you're authoring the page, so don't expect it to be more than it needs to be. It has to be functionally correct and it's nice if it's at least reasonably readable, since in practice we *do* end up looking at generated page source at various points in web page development (View Source!), but it doesn't need to be a precise mirror of the original text. ~ Deb From djlewis at acm.org Wed Oct 31 15:20:58 2007 From: djlewis at acm.org (Deb Lewis) Date: Wed, 31 Oct 2007 12:20:58 -0700 Subject: [Masterview-users] conditional styling of html elements In-Reply-To: References: Message-ID: <20071031122058829124.12a4a90b@acm.org> Nico - I'll follow up on the alt versions of your scenario when I have a chance to set up a test site to play with some of this, but glad to hear you've got a workable solution for now for your nav link highlighting (even if not necessarily prettiest/most ideal notation). > > Something else I noticed: > > Why does masterview change the formatting of my html? > [... snip... example of line break changing in DOCTYPE decl...] > > I think I saw such more or less sutbtle changes in other places as well. But > I can't remember where right now. I think tabs were ignored. > I'd prefer the formatting not beeing touched by masterview. > That turns out to pretty fundamental (and I think fairly typical of this sort of template processing). We necessarily have potentially non-trivial changes in the text between the template and the processed output and masterview makes no attempt to preserve the original formatting. I think that's a good design decision, it would be difficult to do accurately and in practice I just don't think it's a problem worth solving. So the short answer is "tough, deal with it"! The nicer response is that you need to let go of that attachment to your source formatting. (As did I, in fact). The masterview output is a generated artifact, it's *not* the master source and it's not the text that you work on when you're authoring the page, so don't expect it to be more than it needs to be. It has to be functionally correct and it's nice if it's at least reasonably readable, since in practice we *do* end up looking at generated page source at various points in web page development (View Source!), but it doesn't need to be a precise mirror of the original text. ~ Deb From jeff.barczewski at gmail.com Wed Oct 31 17:03:01 2007 From: jeff.barczewski at gmail.com (Jeff Barczewski) Date: Wed, 31 Oct 2007 16:03:01 -0500 Subject: [Masterview-users] conditional styling of html elements In-Reply-To: <20071031122058829124.12a4a90b@acm.org> References: <20071031122058829124.12a4a90b@acm.org> Message-ID: <19cda190710311403q76b8a4a2m15e08bd69b38d077@mail.gmail.com> On 10/31/07, Deb Lewis wrote: > > The nicer response is that you need to let go of that attachment to > your source formatting. (As did I, in fact). The masterview output is > a generated artifact, it's *not* the master source and it's not the > text that you work on when you're authoring the page, so don't expect > it to be more than it needs to be. It has to be functionally correct > and it's nice if it's at least reasonably readable, since in practice > we *do* end up looking at generated page source at various points in > web page development (View Source!), but it doesn't need to be a > precise mirror of the original text. > And I believe that we do keep much of the formatting and things in place when we render but it is possible that in a few places we lose some whitespace in the processing. We took a reasonable effort to keep the original as close as possible without adding too much complexity to the code. I think the majority of the discrepancies might be near the transitions between files. I'll try to keep your wishes in mind when we are working on some of the modules, if there are opportunities to improve the retention of whitespace. Blessings, Jeff -- Jeff Barczewski, MasterView core team Inspired Horizons Ruby on Rails Training and Consultancy http://inspiredhorizons.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-users/attachments/20071031/e21831f2/attachment.html