just checking - is this the most succint markup

2 views
Skip to first unread message

JoeE

unread,
Dec 9, 2009, 8:35:25 AM12/9/09
to Haml
Hi, I am just checking that the following is the most succinct way of
creating the following html:

<ul>
<li>
<a href="#">
Text

%ul
%li
%a{:href => '#'}
Text

As a front-ender I am constantly creating links containg blank anchor
href's.
The haml ends up looking a lot 'bigger' (taking up a lot of lines
particularly) in haml than it does in html. As written in html it
would look like:

<ul>
<li><a href="#">Text</a></li>
</ul>

Thanks

G. Sobrinho

unread,
Dec 9, 2009, 11:22:48 AM12/9/09
to Haml
You can use this:

%ul
%li
%a(href='#')
Text


Or inline text:

%a(href='#') Text

Widi Harsojo

unread,
Dec 10, 2009, 12:36:57 AM12/10/09
to ha...@googlegroups.com
in my w2tags, I create a macro helper "-li_a",

!H!_li_a
%li$$ (%a{href='#'} $0%)

%ul
-li_a.mnu Text1;Text2;Text3

and it will produce tag:
<ul>
<li class="mnu"><a href='#'>Text1</a></li>
<li class="mnu"><a href='#'>Text2</a></li>
<li class="mnu"><a href='#'>Text3</a></li>
</ul>

you can try at: http://w2tags.heroku.com/
> --
>
> You received this message because you are subscribed to the Google Groups "Haml" group.
> To post to this group, send email to ha...@googlegroups.com.
> To unsubscribe from this group, send email to haml+uns...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/haml?hl=en.
>
>
>



--
/wh

e=mc2inhologram
Reply all
Reply to author
Forward
0 new messages