Friday, July 13, 2007

Do you write HTML? Do you care if it's XHTML compliant? You should. I've been playing around a bit with Ruby and Ruby on Rails and recently came across Haml, an application written in Ruby that takes the drudgery out of all those angle brackets to help you get XHTML-compliant markup faster. It's meant to be used as a replacement for templates in Rails applications, but is easy to use outside of Rails.

I downloaded Haml and produced this markup:


<div class="'mainContent'">
<h2This is huge!</h2>
<ul>
<li>One Item</li>
<li>Another Item</li>
</ul>
<strong>2007-07-13T23:33:34-05:00</strong>
</div>


I simply pointed the Haml parser to a file that looked like this:

.mainContent
%H2 This is huge!
%ul
%li One Item
%li Another Item
- now = DateTime.now
%strong= now

It took another 5 minutes or so to take the output above (the valid XHTML) and spit out a .html file. I could easily change the extension to .aspx and have a helpful start to my pages, (especially if I had taken better notes at the semantic HTML training at work). And even better, how about having Haml in IronRuby and writing the above code in visual studio, with intellisense! That may not be far off, see my last post for more IronRuby.

Would something like this be useful for the client-side gurus? Anybody writing Html, let me know what you think, and I'll see what our resident expert, Michael, thinks.

3 comments:

Leat Hakkor said...
This comment has been removed by the author.
Anonymous said...

One idea is to create a Haml viewengine for MonoRail http://www.castleproject.org/monorail/index.html

Anonymous said...

learn about my new blog -

[url=http://trailfire.com/adipex_online_f13?tab=Comments] ambien and driving [/url]

http://trailfire.com/adipex_online_f13?tab=Comments
[url=http://trailfire.com/adipex_online_f13?tab=Comments] ambien 10mg [/url]