PLDB
Languages Features Calendar About Lists Add Language
GitHub icon

HAML

HAML

HAML, aka HTML Abstraction Markup Language, is a template language created in 2006 by Hampton Catlin.

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...

Try now: Web

#128on PLDB 16Years Old 6.3kUsers

Example code from the web:

%section.container %h1= post.title %h2= post.subtitle .content = post.content

Example code from hello-world:

%html %title Hello World %body %h1 Hello World

Example code from Linguist:

%p Hello, World!

Example code from Wikipedia:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'> <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 Example Token
Comments
-# A comment
Line Comments
-# A comment
-#
Semantic Indentation
Disk Output ϴ

Books about HAML on goodreads

title author year reviews ratings rating
HTML: Hypertext Markup Language, Cascading Style Sheets, Dynamic HTML, Extensible Hypertext Markup Language, Html5, Haml, Webfarbe Books LLC 2010 0 2 5.00

Article source

PLDB - Build the next great programming language. v5.0.0 - Acknowledgements · Email · GitHub