Top 1,000 Features Creators Events Podcasts Extensions Blog Explorer CSV Download


< >

HAML, aka HTML Abstraction Markup Language, is an open source template language created in 2006 by Hampton Lintorn-Catlin.

#74on PLDB 18Years Old 323Repos
Download source code:
git clone

Try now: Web

Haml (HTML Abstraction Markup Language) is a templating system that is designed to avoid writing inline code in a web document and make the HTML easy and clean. Haml gives the flexibility to have some dynamic content in HTML. Similar to other web languages like PHP, ASP, JSP and template systems like eRuby, Haml also embeds some code that gets executed during runtime and generates HTML code in order to provide some dynamic content. Read more on Wikipedia...

Example from the web:
%section.container %h1= post.title %h2= post.subtitle .content = post.content
Example from hello-world:
%html %title Hello World %body %h1 Hello World
Example from Linguist:
%p Hello, World!
Example from Wikipedia:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> <html lang='en' xml:lang='en' xmlns=''> <head> <title>BoBlog</title> <meta content='text/html; charset=utf-8' http-equiv='Content-Type' /> <link href="/stylesheets/main.css" media="screen" rel="Stylesheet" type="text/css" /> </head> <body> <div id='header'> <h1>BoBlog</h1> <h2>Bob's Blog</h2> </div> <div id='content'> <div class='entry'> <h3 class='title'>Halloween</h3> <p class='date'>Tuesday, October 31, 2006</p> <p class='body'> Happy Halloween, glorious readers! I'm going to a party this evening... I'm very excited. </p> </div> <div class='entry'> <h3 class='title'>New Rails Templating Engine</h3> <p class='date'>Friday, August 11, 2006</p> <p class='body'> There's a very cool new Templating Engine out for Ruby on Rails. It's called Haml. </p> </div> </div> <div id='footer'> <p> All content copyright © Bob </p> </div> </body> </html>

Language features

Feature Supported Token Example
-# A comment
Line Comments -#
-# A comment
Semantic Indentation
Disk Output X

View source

- Build the next great programming language · About · Resources · Acknowledgements · Part of the World Wide Scroll