List Info

Thread: What's up with the %?




What's up with the %?
country flaguser name
United States
2007-08-19 21:27:08
I'm new to HAML and a big fan of it so far. Converted my
rails app to
HAML in about 2 hours and am really happy with the look of
it.
However, I searched the group to find any discussion on what
the
reasoning for using the % symbol for defining elements. I
don't mind
it, but it seems to be that there's a much cleaner and
obvious way to
formatting HAML.

Using the wikipedia example: http://en.wikipedia
.org/wiki/Haml

Why not format it as the following?

!!!
html{ mlns
=> "http://www.w3.org/
1999/xhtml", :lang => "en",
'xml:lang' => "en" }
  head
    title BoBlog
    meta{ 'http-equiv' => 'Content-Type', :content =>
'text/html;
charset=utf-8' }/
    = stylesheet_link_tag 'main'
  body
    #header
      h1 BoBlog
      h2 Bob's Blog
    #content
      - entries.each do |entry|
        .entry
          h3.title= entry.title
          p.date= entry.posted.strftime("%A, %B %d,
%Y")
          p.body= entry.body
    #footer
      p
        All content copyright (c) Bob

Is that harder to parse? Is it more of an implementation or
a style
issue?

I know this has probably been discussed before, but I'm just
curious.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Haml" group.
To post to this group, send email to hamlgooglegroups.com
To unsubscribe from this group, send email to
haml-unsubscribegooglegroups.com
For more options, visit this group at http://grou
ps.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: What's up with the %?
user name
2007-08-19 21:30:13
The % was chosen because I wanted to be able to have plain
tetxt lines


%title
  content

title
  content

Tags are explicit instead of implicit. And, I wanted to be
able to
keep it more freeform.

Percent was chosen particularily because its SHIFT-5 which
isn't too
hard to hit.

-hampton.

On 8/19/07, jc <jcnetdevgmail.com> wrote:
>
> I'm new to HAML and a big fan of it so far. Converted
my rails app to
> HAML in about 2 hours and am really happy with the look
of it.
> However, I searched the group to find any discussion on
what the
> reasoning for using the % symbol for defining elements.
I don't mind
> it, but it seems to be that there's a much cleaner and
obvious way to
> formatting HAML.
>
> Using the wikipedia example: http://en.wikipedia
.org/wiki/Haml
>
> Why not format it as the following?
>
> !!!
> html{ mlns
=> "http://www.w3.org/
1999/xhtml", :lang => "en",
> 'xml:lang' => "en" }
>   head
>     title BoBlog
>     meta{ 'http-equiv' => 'Content-Type', :content
=> 'text/html;
> charset=utf-8' }/
>     = stylesheet_link_tag 'main'
>   body
>     #header
>       h1 BoBlog
>       h2 Bob's Blog
>     #content
>       - entries.each do |entry|
>         .entry
>           h3.title= entry.title
>           p.date= entry.posted.strftime("%A, %B
%d, %Y")
>           p.body= entry.body
>     #footer
>       p
>         All content copyright (c) Bob
>
> Is that harder to parse? Is it more of an
implementation or a style
> issue?
>
> I know this has probably been discussed before, but I'm
just curious.
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Haml" group.
To post to this group, send email to hamlgooglegroups.com
To unsubscribe from this group, send email to
haml-unsubscribegooglegroups.com
For more options, visit this group at http://grou
ps.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: What's up with the %?
country flaguser name
United States
2007-08-19 21:35:26
Cool. That makes sense. But technically it would have been
possible
without the % right? Since the content lines wont have any
children,
you could just display them as is without adding tags.



On Aug 19, 7:30 pm, Hampton <hcat...gmail.com> wrote:
> The % was chosen because I wanted to be able to have
plain tetxt lines
>
> %title
>   content
>
> title
>   content
>
> Tags are explicit instead of implicit. And, I wanted to
be able to
> keep it more freeform.
>
> Percent was chosen particularily because its SHIFT-5
which isn't too
> hard to hit.
>
> -hampton.
>
> On 8/19/07, jc <jcnet...gmail.com> wrote:
>
>
>
> > I'm new to HAML and a big fan of it so far.
Converted my rails app to
> > HAML in about 2 hours and am really happy with the
look of it.
> > However, I searched the group to find any
discussion on what the
> > reasoning for using the % symbol for defining
elements. I don't mind
> > it, but it seems to be that there's a much cleaner
and obvious way to
> > formatting HAML.
>
> > Using the wikipedia example:http://en.wikipedia
.org/wiki/Haml
>
> > Why not format it as the following?
>
> > !!!
> > html{ mlns
=> "http://www.w3.org/
1999/xhtml", :lang => "en",
> > 'xml:lang' => "en" }
> >   head
> >     title BoBlog
> >     meta{ 'http-equiv' => 'Content-Type',
:content => 'text/html;
> > charset=utf-8' }/
> >     = stylesheet_link_tag 'main'
> >   body
> >     #header
> >       h1 BoBlog
> >       h2 Bob's Blog
> >     #content
> >       - entries.each do |entry|
> >         .entry
> >           h3.title= entry.title
> >           p.date= entry.posted.strftime("%A,
%B %d, %Y")
> >           p.body= entry.body
> >     #footer
> >       p
> >         All content copyright (c) Bob
>
> > Is that harder to parse? Is it more of an
implementation or a style
> > issue?
>
> > I know this has probably been discussed before,
but I'm just curious.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Haml" group.
To post to this group, send email to hamlgooglegroups.com
To unsubscribe from this group, send email to
haml-unsubscribegooglegroups.com
For more options, visit this group at http://grou
ps.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: What's up with the %?
country flaguser name
United States
2007-08-19 21:38:29
By way of example, the last bit of your example would have
rendered as

<div id="footer">
  <p>
    <All>content copyright (c) Bob</All>
  </p>
</div>

See? It gets confusing.

- Nathan

Hampton wrote:
> The % was chosen because I wanted to be able to have
plain tetxt lines
>
>
> %title
>   content
>
> title
>   content
>
> Tags are explicit instead of implicit. And, I wanted to
be able to
> keep it more freeform.
>
> Percent was chosen particularily because its SHIFT-5
which isn't too
> hard to hit.
>
> -hampton.
>
> On 8/19/07, jc <jcnetdevgmail.com> wrote:
>   
>> I'm new to HAML and a big fan of it so far.
Converted my rails app to
>> HAML in about 2 hours and am really happy with the
look of it.
>> However, I searched the group to find any
discussion on what the
>> reasoning for using the % symbol for defining
elements. I don't mind
>> it, but it seems to be that there's a much cleaner
and obvious way to
>> formatting HAML.
>>
>> Using the wikipedia example: http://en.wikipedia
.org/wiki/Haml
>>
>> Why not format it as the following?
>>
>> !!!rspec
>> html{ mlns
=> "http://www.w3.org/
1999/xhtml", :lang => "en",
>> 'xml:lang' => "en" }
>>   head
>>     title BoBlog
>>     meta{ 'http-equiv' => 'Content-Type',
:content => 'text/html;
>> charset=utf-8' }/
>>     = stylesheet_link_tag 'main'
>>   body
>>     #header
>>       h1 BoBlog
>>       h2 Bob's Blog
>>     #content
>>       - entries.each do |entry|
>>         .entry
>>           h3.title= entry.title
>>           p.date= entry.posted.strftime("%A,
%B %d, %Y")
>>           p.body= entry.body
>>     #footer
>>       p
>>         All content copyright (c) Bob
>>
>> Is that harder to parse? Is it more of an
implementation or a style
>> issue?
>>
>> I know this has probably been discussed before, but
I'm just curious.
>>
>>
>>     
>
> >
>
>   


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Haml" group.
To post to this group, send email to hamlgooglegroups.com
To unsubscribe from this group, send email to
haml-unsubscribegooglegroups.com
For more options, visit this group at http://grou
ps.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: What's up with the %?
user name
2007-08-19 21:39:08
But, empty tags are totally encouraged (especially for js).

%title
  %content

should be possible. Ok, well maybe not for title.

The real solution would be to have a hardcoded list of tags.
But, it
sstill a bitb werid with different versions of different
markups (xml,
etc).

-h.

On 8/19/07, jc <jcnetdevgmail.com> wrote:
>
> Cool. That makes sense. But technically it would have
been possible
> without the % right? Since the content lines wont have
any children,
> you could just display them as is without adding tags.
>
>
>
> On Aug 19, 7:30 pm, Hampton <hcat...gmail.com> wrote:
> > The % was chosen because I wanted to be able to
have plain tetxt lines
> >
> > %title
> >   content
> >
> > title
> >   content
> >
> > Tags are explicit instead of implicit. And, I
wanted to be able to
> > keep it more freeform.
> >
> > Percent was chosen particularily because its
SHIFT-5 which isn't too
> > hard to hit.
> >
> > -hampton.
> >
> > On 8/19/07, jc <jcnet...gmail.com> wrote:
> >
> >
> >
> > > I'm new to HAML and a big fan of it so far.
Converted my rails app to
> > > HAML in about 2 hours and am really happy
with the look of it.
> > > However, I searched the group to find any
discussion on what the
> > > reasoning for using the % symbol for defining
elements. I don't mind
> > > it, but it seems to be that there's a much
cleaner and obvious way to
> > > formatting HAML.
> >
> > > Using the wikipedia example:http://en.wikipedia
.org/wiki/Haml
> >
> > > Why not format it as the following?
> >
> > > !!!
> > > html{ mlns
=> "http://www.w3.org/
1999/xhtml", :lang => "en",
> > > 'xml:lang' => "en" }
> > >   head
> > >     title BoBlog
> > >     meta{ 'http-equiv' => 'Content-Type',
:content => 'text/html;
> > > charset=utf-8' }/
> > >     = stylesheet_link_tag 'main'
> > >   body
> > >     #header
> > >       h1 BoBlog
> > >       h2 Bob's Blog
> > >     #content
> > >       - entries.each do |entry|
> > >         .entry
> > >           h3.title= entry.title
> > >           p.date=
entry.posted.strftime("%A, %B %d, %Y")
> > >           p.body= entry.body
> > >     #footer
> > >       p
> > >         All content copyright (c) Bob
> >
> > > Is that harder to parse? Is it more of an
implementation or a style
> > > issue?
> >
> > > I know this has probably been discussed
before, but I'm just curious.
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Haml" group.
To post to this group, send email to hamlgooglegroups.com
To unsubscribe from this group, send email to
haml-unsubscribegooglegroups.com
For more options, visit this group at http://grou
ps.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: What's up with the %?
user name
2007-08-19 21:39:27
Yeck! My keyboard went nutty... sorry about those random
typos.

On 8/19/07, Hampton <hcatlingmail.com> wrote:
> But, empty tags are totally encouraged (especially for
js).
>
> %title
>   %content
>
> should be possible. Ok, well maybe not for title.
>
> The real solution would be to have a hardcoded list of
tags. But, it
> sstill a bitb werid with different versions of
different markups (xml,
> etc).
>
> -h.
>
> On 8/19/07, jc <jcnetdevgmail.com> wrote:
> >
> > Cool. That makes sense. But technically it would
have been possible
> > without the % right? Since the content lines wont
have any children,
> > you could just display them as is without adding
tags.
> >
> >
> >
> > On Aug 19, 7:30 pm, Hampton <hcat...gmail.com> wrote:
> > > The % was chosen because I wanted to be able
to have plain tetxt lines
> > >
> > > %title
> > >   content
> > >
> > > title
> > >   content
> > >
> > > Tags are explicit instead of implicit. And, I
wanted to be able to
> > > keep it more freeform.
> > >
> > > Percent was chosen particularily because its
SHIFT-5 which isn't too
> > > hard to hit.
> > >
> > > -hampton.
> > >
> > > On 8/19/07, jc <jcnet...gmail.com> wrote:
> > >
> > >
> > >
> > > > I'm new to HAML and a big fan of it so
far. Converted my rails app to
> > > > HAML in about 2 hours and am really
happy with the look of it.
> > > > However, I searched the group to find
any discussion on what the
> > > > reasoning for using the % symbol for
defining elements. I don't mind
> > > > it, but it seems to be that there's a
much cleaner and obvious way to
> > > > formatting HAML.
> > >
> > > > Using the wikipedia example:http://en.wikipedia
.org/wiki/Haml
> > >
> > > > Why not format it as the following?
> > >
> > > > !!!
> > > > html{ mlns
=> "http://www.w3.org/
1999/xhtml", :lang => "en",
> > > > 'xml:lang' => "en" }
> > > >   head
> > > >     title BoBlog
> > > >     meta{ 'http-equiv' =>
'Content-Type', :content => 'text/html;
> > > > charset=utf-8' }/
> > > >     = stylesheet_link_tag 'main'
> > > >   body
> > > >     #header
> > > >       h1 BoBlog
> > > >       h2 Bob's Blog
> > > >     #content
> > > >       - entries.each do |entry|
> > > >         .entry
> > > >           h3.title= entry.title
> > > >           p.date=
entry.posted.strftime("%A, %B %d, %Y")
> > > >           p.body= entry.body
> > > >     #footer
> > > >       p
> > > >         All content copyright (c) Bob
> > >
> > > > Is that harder to parse? Is it more of
an implementation or a style
> > > > issue?
> > >
> > > > I know this has probably been discussed
before, but I'm just curious.
> >
> >
> > > >
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Haml" group.
To post to this group, send email to hamlgooglegroups.com
To unsubscribe from this group, send email to
haml-unsubscribegooglegroups.com
For more options, visit this group at http://grou
ps.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: What's up with the %?
country flaguser name
United States
2007-08-20 11:26:48
jc, that sounds awesome!

I'm also on Textmate and very curious how you remapped like
that.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Haml" group.
To post to this group, send email to hamlgooglegroups.com
To unsubscribe from this group, send email to
haml-unsubscribegooglegroups.com
For more options, visit this group at http://grou
ps.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: What's up with the %?
country flaguser name
United States
2007-08-20 15:07:10
just make a new snippet that responds to
<Shift><Space> and consists
wholly of the character %

--dhc--


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Haml" group.
To post to this group, send email to hamlgooglegroups.com
To unsubscribe from this group, send email to
haml-unsubscribegooglegroups.com
For more options, visit this group at http://grou
ps.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-8]

about | contact  Other archives ( Real Estate discussion Medical topics )