Skip to content

Instantly share code, notes, and snippets.

@ibolmo
Created December 11, 2009 05:40
Show Gist options
  • Select an option

  • Save ibolmo/254010 to your computer and use it in GitHub Desktop.

Select an option

Save ibolmo/254010 to your computer and use it in GitHub Desktop.
// horrible(?) attempt at minimizing global pollution and other tricks made by Jaml.
HAML('simple').
div().adopt().
h1('Some title').
p('Some exciting paragraph text').
br().
ul().adopt().
li('First item').
li('Second item').
li('Third item');
HAML.render('simple');
HAML('product').
div({'class': 'product'}).adopt().
h1(product.title).
p(product.description).
img({src: product.thumbUrl}).
a({href: product.imageUrl, text: 'View larger image'}).
form().adopt().
label({for: 'quantity', text: "Quantity"}).
input({type: 'text', name: 'quantity', id: 'quantity', value: 1}).
input({type: 'submit', value: 'Add to Cart'});
var advancedTemplate = HAML('advanced').
div().
adopt().
p('paragraph').
end().
div().
adopt().
p('another').
render();
HAML('complex').
div().
adopt().
use('simple').
use('product').
end().
div().
adopt().
use(advancedTemplate);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment