Read more here
To compile the files just run
haml index.haml index.html && coffee -c app.coffee
You might be interested in the following command line tools to compile files automatically
Friendlier tools
Read more here
To compile the files just run
haml index.haml index.html && coffee -c app.coffee
You might be interested in the following command line tools to compile files automatically
Friendlier tools
companies = [{"id":1,"ticker":"AAPL","name":"Apple Inc"}, | |
{"id":2,"ticker":"ABC","name":"Amerisourcebergen Corp"}, | |
{"id":3,"ticker":"ABT","name":"Abbott Labs"}, | |
{"id":4,"ticker":"ACE","name":"Ace Ltd"}, | |
{"id":5,"ticker":"ADBE","name":"Adobe Sys Inc"}] | |
_.templateSettings = interpolate :/\{\{(.+?)\}\}/g | |
$ -> | |
template = $('#templates .company_li').html() | |
htmlstr = ( _.template( template, c) for c in companies) | |
$('#companies ul').append htmlstr.join '' |
!!! 5 | |
%html | |
%head | |
%title Test | |
%script{:src => 'http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.2.2/underscore-min.js'} | |
%script{:src => 'http://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.1/jquery.min.js'} | |
%script{:src => 'app.js'} | |
%body | |
#templates{:style=>'display:none'} | |
.company_li | |
%li | |
%span.ticker {{ticker}} | |
%span.name {{name}} | |
#companies | |
%ul |