@John Schult

I think you're missing the point entirely. This is not an
optimization, technically it will only slow things down because it's
syntactic sugar. That's all that HAML is: syntactic sugar for HTML. By
NOT relying on your framework's 'helpers' and 'partials' and
incorporating it into the templating system, you DEcouple this
functionality from a specific framework.

BTW part of my drive for this is that I don't use a framework. Well, I
do use Rack. Rack and HAML.

Here's specifically what I'm talking about because it doesn't seem to
be 'clicking'... yes it's contrived, but should get the point across:

[index.html.haml]
%html
  %head
    ^common/head{ :title => 'PseudoHAML' }
  %body
    ^common/pagehead{ :heading => 'A stupid little demo' }
  %p
    This text is unique to this page


[common/head.html.haml]
%meta{ 'http-equiv' => 'Content-Type', 'content' => 'application/xhtml
+xml;charset=utf-8' }
%title= @title


[common/pagehead.html.haml]
.header
  %img{ :src => '/images/header.png' }
  %h1= @heading


# renders as


<html>
  <head>
    <meta content="application/xhtml+xml;charset=utf-8" http-
equiv="Content-Type" />
    <title>PseudoHaml</title>
  </head>
  <body>
    <div class="header">
      <img src="/images/header.png" />
      <h1>A stupid little demo</h1>
    </div>
    <p>
      This text is unique to this page
    </p>
  </body>
</html>



nothing more, nothing less


On Oct 23, 4:30 pm, John Schult <[EMAIL PROTECTED]> wrote:
> On Oct 23, 5:18 pm, PEZ <[EMAIL PROTECTED]> wrote:
>
> > I like this idea a lot! It speaks hamlish the way I interpreted it
> > when I stumbled across it the other day. Markup should be beautiful!
>
> > Maybe it would be possible to use two chars? Like:
>
> > %%foo{ :localvar => @vartobind }
>
> Sure, if you are using Rails.  I'm not, I use Merb.  IMO Haml should
> not include specific framework helper "optimization".  Really? Is it
> that hard to type out:
>
> = partial :header
>
> Kind regards,
>
> John Schult
>
> --
> Be kind, stop top posting!  http://bit.ly/4nErpi
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to