# \[ANN\] Haml 1.0 - Stable Sam (!)

**URL:** <https://www.ruby-forum.com/t/ann-haml-1-0-stable-sam/82360>\
**Category:** Rails\
**Created:** [January 19, 2007, 4:29pm UTC](https://www.ruby-forum.com/t/ann-haml-1-0-stable-sam/82360 "2007-01-19T16:29:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 19, 2007, 4:29pm UTC](https://www.ruby-forum.com/t/ann-haml-1-0-stable-sam/82360/1 "2007-01-19T16:29:40Z")

</div>

I totally forgot to make this announcement anywhere except for the Haml  
mailing list. Whoops!

On December 25, 2006, we released Haml 1.0!

Today we’re at 1.0.2. Give it a whirl!

./script/plugin install svn://hamptoncatlin.com/haml/tags/stable

We feel that Haml is now at a nice stable place and is feature rich  
enough to blow away any of the template languages you’ve used in the  
past. We listened to what you guys wanted, and we have delivered  
without diluting the original ideals.

Haml is _not_ just a one off “cool idea” for nerds. It has garnered a  
proven track record for both Software Developers and Web Designers. At  
Unspace, we continually use it for all of our projects and are even  
more committed to using it in the future. Flat out, Haml makes us more  
efficient and better programmers. It makes our code short, to the  
point, manageable and sexy.

In fact, Haml is even getting coverage in the upcoming Apress book  
“Beginning Rails” as the goto high-productivity way to create your  
templates.

I know a lot of you looked into Haml right after the initial talk and  
haven’t really given it another glance, but I’d highly recommend you  
read this [http://hamptoncatlin.com/2007/haml-1-0-stable-sam](http://hamptoncatlin.com/2007/haml-1-0-stable-sam) It gives a  
run down on the “road to 1.0” and what we’ve added.

------------ The Future ------------

Also, we are hard at work on the 1.5 branch where we are going to  
release something that is basically an abstraction of CSS. Why? Because  
we think CSS is ugly and bloated and our poor designers are floundering  
in its painful syntax. We will be rolling out Sass in not too long.

Into the future beyond that, we are looking to build a fragment cache  
for use around your site. LetIt::REST is a tool for helping you keep  
your Rest controllers as simple and straight-foreward as you can muster  
(imagine a configurable Rest controller in 4 lines. No joke!).

Haml represents more than just a template language. It represents a  
flowering of Rails around a philosophy of simplicity and customization.  
It represents a new way to think about your CSS classes, your model  
classes, your view classes, and the structures and rules around those  
things.

Go find out more about the current state of things at  
[http://haml.hamptoncatlin.com](http://haml.hamptoncatlin.com)

To ride the edge… and see these new features…

./script/plugin install svn://hamptoncatlin.com/haml/trunk

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 19, 2007, 4:30pm UTC](https://www.ruby-forum.com/t/ann-haml-1-0-stable-sam/82360/2 "2007-01-19T16:30:43Z")

</div>

Not at the moment.

But there is nothing about the language specification that ties it to  
ruby. So, I’m excited to see it get converted to another language. If  
my Java skills weren’t so rusty, I’d be on it already.

-hampton.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 19, 2007, 4:30pm UTC](https://www.ruby-forum.com/t/ann-haml-1-0-stable-sam/82360/3 "2007-01-19T16:30:05Z")

</div>

Congratulations!

I look forward to seeing your style language.

Is anybody implementing Haml for Java or Groovy?

Happy New Year!

Justin F.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 25, 2007, 10:31pm UTC](https://www.ruby-forum.com/t/ann-haml-1-0-stable-sam/82360/4 "2007-09-25T22:31:21Z")

</div>

I think I’m ready to make use of Haml. I remember your original  
announcements a number of months ago and the project certainly has  
matured  
since. The documentation I’ve read is a little light on the subject of  
integration with a Rails app.

Is it possible to use Haml out-of-the-box for ActionMailer templates?

Can one construct their layouts in the same manner as rhtml templates  
using  
content\_for\_layout to fold in view templates?

Thanks!

Taylor S.,  
Reality Technician

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 25, 2007, 10:45pm UTC](https://www.ruby-forum.com/t/ann-haml-1-0-stable-sam/82360/5 "2007-09-25T22:45:24Z")

</div>

Thanks for the response, Justin.

I got pretty into using Haml very quickly, and figured out as you told  
me  
that it did in fact work fine with ActionMailer.

I have had some frustrations occasionally when tab order in templates.

For example, I’ve had problems with code like this not having kEND  
closures…

%table.list  
%thead  
%tr  
%th  
This  
- if this and that  
= this\_function  
%tbody  
%tr  
%td This and that and this

( I just did that on the fly, but assume all spaces line up as they are  
supposed to where I consider table, thead, tr, th, and td all to be  
“block-enducing” (and thus indenting) tags.

Am I just delusional about my tabbing?

Thanks

The code is so much more readable in this fashion and I’d like to  
convert my  
site a bit more to it if I could get around some of these small issues  
I’ve  
been having.

D. Taylor S.,  
Reality Technician

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 25, 2007, 10:50pm UTC](https://www.ruby-forum.com/t/ann-haml-1-0-stable-sam/82360/6 "2007-09-25T22:50:24Z")

</div>

Taylor-

Haml does work out-of-the box with ActionMailer. Haml integrates in  
with ActionView totally so that ActionView knows what to do when it  
seems Haml. If something is broken with that side of our integration,  
post about it and we will get it fixed up for you.

Haml works just like your Rhtml templates in its relation to Rails.  
ActionView notices that a file ends in .haml and will render it using  
the Haml engine. A common layouts/application.haml file might look  
something like this.

!!! Strict  
%html  
%head  
%title= controller.controller\_name  
= stylesheet\_link\_tag :defaults  
%body  
#page  
#header  
%h1= My Website  
= render :partial =\> ‘shared/logged\_’ + (logged\_in? ? ‘in’ :  
‘out’)  
#content= content\_for\_layout  
#footer  
Copyright **Hampton Catlin** 2007

Also, you can use ‘yield’ instead of content\_for\_layout. This is a  
pretty common file in most of my projects. And, its the one I’d usually  
recommend people switch to first. Even with a legacy project, you can  
give Haml a spin by converting the application.rhtml file over to  
application.haml. The biggest bonus there is that your website’s XHTML  
will instantly look much better.

I find the delete key to be my favourite key on the keyboard. I love  
going around and deleting all the cruft from my old rhtml files and  
looking at my new streamlined Haml file.

Anyhow, goodluck. Stay in touch and feel free to ask questions.

-hampton.

On Jan 13, 8:35 pm, “D. Taylor S.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 25, 2007, 10:49pm UTC](https://www.ruby-forum.com/t/ann-haml-1-0-stable-sam/82360/7 "2007-09-25T22:49:24Z")

</div>

When you are doing a block in Haml, you have to indent.

To do this…

\<% if current\_user %\>  
\<%= print\_user(current\_user) %\>  
\<% else %\>  
\<%= render :partial =\> ‘signup’ %\>  
\<% end %\>

Would be

- if current\_user  
= print\_user(current\_user)
- else  
= render :partial =\> ‘signup’

So, you must indent while you are inside of the block. The next line  
that is even with an open block, will instantly close it.

-hampton.
