is there a way of cleaning rails'' html output? by default, it looks real ugly (in terms of indentation), and i don''t know how people can live with that. there is rails-tidy, and although it makes html really pretty, setting it up involves some tricky workarounds, and the author also commented: "THIS IS CERTAINLY A RESOURCE HOG. I’m not interrested in this feature so I didn’t benchmarked it but at first sight rendering is at least 2 times slower with the filter enabled."? is there anything better out there? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 17 Apr 2008, at 13:44, Mister Blood Rails wrote:> > is there a way of cleaning rails'' html output? by default, it looks > real ugly (in terms of indentation), and i don''t know how people can > live with that. there is rails-tidy, and although it makes html really > pretty, setting it up involves some tricky workarounds, and the author > also commented: > > "THIS IS CERTAINLY A RESOURCE HOG. I’m not interrested in this feature > so I didn’t benchmarked it but at first sight rendering is at least 2 > times slower with the filter enabled."? > > is there anything better out there?From my fuzzy memories of when I saw a session about haml a year or 2 ago it was one of its goals. Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
<opinion> If it renders fine in a browser, who cares what it looks like under the hood? </opinion> That being said, haml as a replacement for erb, produces some nicely formatted html if you''re into viewing page source. It may have been a goal of the author, but I just like the cleaner forms I have to produce. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Yeah HAML is gorgeous, however, it''s whitespace sensitive making it impossible for me to join things that should be joined. On Apr 17, 8:52 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 17 Apr 2008, at 13:44, Mister Blood Rails wrote: > > > > > is there a way of cleaning rails'' html output? by default, it looks > > real ugly (in terms of indentation), and i don''t know how people can > > live with that. there is rails-tidy, and although it makes html really > > pretty, setting it up involves some tricky workarounds, and the author > > also commented: > > > "THIS IS CERTAINLY A RESOURCE HOG. I’m not interrested in this feature > > so I didn’t benchmarked it but at first sight rendering is at least 2 > > times slower with the filter enabled."? > > > is there anything better out there? > > From my fuzzy memories of when I saw a session about haml a year or 2 > ago it was one of its goals. > > Fred--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
*shudder* XHTML: <small class="code" id="message">Hello, World!</small> Haml: %small{:class => "code", :id => "message"} Hello, World! Seems less gorgeous to me... >_> I like my rhtml. Although I dunno how your output doesn''t look nice, mine does. Perhaps you''re using tags I''m not. On Apr 17, 8:07 am, Mister Blood Rails <bloodra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Yeah HAML is gorgeous, however, it''s whitespace sensitive making it > impossible for me to join things that should be joined. > > On Apr 17, 8:52 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > On 17 Apr 2008, at 13:44, Mister Blood Rails wrote: > > > > is there a way of cleaning rails'' html output? by default, it looks > > > real ugly (in terms of indentation), and i don''t know how people can > > > live with that. there is rails-tidy, and although it makes html really > > > pretty, setting it up involves some tricky workarounds, and the author > > > also commented: > > > > "THIS IS CERTAINLY A RESOURCE HOG. I’m not interrested in this feature > > > so I didn’t benchmarked it but at first sight rendering is at least 2 > > > times slower with the filter enabled."? > > > > is there anything better out there? > > > From my fuzzy memories of when I saw a session about haml a year or 2 > > ago it was one of its goals. > > > Fred--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
In all seriousness, I''ve been doing web programming for a long time. If I''m generating HTML from a web application, I just don''t care what the rendered HTML code looks like, and I can''t figure out why people do. This isn''t the first time I''ve seen this question, so am I missing something? If it validates, and it renders, then does it matter? On Thu, Apr 17, 2008 at 8:12 AM, kopf1988 <kopf1988-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > *shudder* > > XHTML: > <small class="code" id="message">Hello, World!</small> > > Haml: > %small{:class => "code", :id => "message"} Hello, World! > > Seems less gorgeous to me... >_> I like my rhtml. Although I dunno how > your output doesn''t look nice, mine does. Perhaps you''re using tags > I''m not. > > On Apr 17, 8:07 am, Mister Blood Rails <bloodra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Yeah HAML is gorgeous, however, it''s whitespace sensitive making it > > impossible for me to join things that should be joined. > > > > On Apr 17, 8:52 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > > > On 17 Apr 2008, at 13:44, Mister Blood Rails wrote: > > > > > > is there a way of cleaning rails'' html output? by default, it looks > > > > real ugly (in terms of indentation), and i don''t know how people can > > > > live with that. there is rails-tidy, and although it makes html > really > > > > pretty, setting it up involves some tricky workarounds, and the > author > > > > also commented: > > > > > > "THIS IS CERTAINLY A RESOURCE HOG. I''m not interrested in this > feature > > > > so I didn''t benchmarked it but at first sight rendering is at least > 2 > > > > times slower with the filter enabled."? > > > > > > is there anything better out there? > > > > > From my fuzzy memories of when I saw a session about haml a year or 2 > > > ago it was one of its goals. > > > > > Fred > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I just think good design should flow through every aspect of an app... On Apr 17, 9:28 pm, "Brian Hogan" <bpho...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> In all seriousness, I''ve been doing web programming for a long time. If I''m > generating HTML from a web application, I just don''t care what the rendered > HTML code looks like, and I can''t figure out why people do. This isn''t the > first time I''ve seen this question, so am I missing something? If it > validates, and it renders, then does it matter? > > On Thu, Apr 17, 2008 at 8:12 AM, kopf1988 <kopf1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > *shudder* > > > XHTML: > > <small class="code" id="message">Hello, World!</small> > > > Haml: > > %small{:class => "code", :id => "message"} Hello, World! > > > Seems less gorgeous to me... >_> I like my rhtml. Although I dunno how > > your output doesn''t look nice, mine does. Perhaps you''re using tags > > I''m not. > > > On Apr 17, 8:07 am, Mister Blood Rails <bloodra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Yeah HAML is gorgeous, however, it''s whitespace sensitive making it > > > impossible for me to join things that should be joined. > > > > On Apr 17, 8:52 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > wrote: > > > > > On 17 Apr 2008, at 13:44, Mister Blood Rails wrote: > > > > > > is there a way of cleaning rails'' html output? by default, it looks > > > > > real ugly (in terms of indentation), and i don''t know how people can > > > > > live with that. there is rails-tidy, and although it makes html > > really > > > > > pretty, setting it up involves some tricky workarounds, and the > > author > > > > > also commented: > > > > > > "THIS IS CERTAINLY A RESOURCE HOG. I''m not interrested in this > > feature > > > > > so I didn''t benchmarked it but at first sight rendering is at least > > 2 > > > > > times slower with the filter enabled."? > > > > > > is there anything better out there? > > > > > From my fuzzy memories of when I saw a session about haml a year or 2 > > > > ago it was one of its goals. > > > > > Fred--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I just look at it in firebug to see the layout. Much easier that dealing with the raw source and links the css nicely as well. Fundamentally in Rails, it is how clean the ERB is to look at rather than the HTML. You don''t take a C program and then complain that the assembler output from the compiler is not very pretty. On Apr 17, 1:44 pm, Mister Blood Rails <bloodra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> is there a way of cleaning rails'' html output? by default, it looks >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
How about (HAML): %small#message.code Hello, World! === <small class="code" id="message">Hello, World!</small> Now that''s gorgeous. I know which I''d rather type. You only need to use the hash braces if you''re doing something more conditional, and then you can just put it in a helper and call the method e.g. %small{choose_class(somevar)} Hello, World! def choose_class(somevar) {:class => somevar ||= ''default'', :id => ''message''} ##approximately, untested! end I agree the 2-space indenting can be a pain, well it was till i discovered my text editor did multi-line select. HAML rules, and SASS makes CSS like it should be ;-) Each to their own though.... On Apr 17, 2:12 pm, kopf1988 <kopf1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> *shudder* > > XHTML: > <small class="code" id="message">Hello, World!</small> > > Haml: > %small{:class => "code", :id => "message"} Hello, World! > > Seems less gorgeous to me... >_> I like my rhtml. Although I dunno how > your output doesn''t look nice, mine does. Perhaps you''re using tags > I''m not. > > On Apr 17, 8:07 am, Mister Blood Rails <bloodra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Yeah HAML is gorgeous, however, it''s whitespace sensitive making it > > impossible for me to join things that should be joined. > > > On Apr 17, 8:52 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > > On 17 Apr 2008, at 13:44, Mister Blood Rails wrote: > > > > > is there a way of cleaning rails'' html output? by default, it looks > > > > real ugly (in terms of indentation), and i don''t know how people can > > > > live with that. there is rails-tidy, and although it makes html really > > > > pretty, setting it up involves some tricky workarounds, and the author > > > > also commented: > > > > > "THIS IS CERTAINLY A RESOURCE HOG. I’m not interrested in this feature > > > > so I didn’t benchmarked it but at first sight rendering is at least 2 > > > > times slower with the filter enabled."? > > > > > is there anything better out there? > > > > From my fuzzy memories of when I saw a session about haml a year or 2 > > > ago it was one of its goals. > > > > Fred--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Wildtangent wrote:> Each to their own though....Agreed... my standard indentation in Rails (controllers, models, helpers, etc) is 2 spaces, so doing that for the views is just second nature (be it erb or haml)... but I''m a lazy bastidge at heart, so if indentation can imply all those closing tags and the view code is less for my poor brain to process, I''m all for it. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---