A command line tool to automatically compile haml templates to javascript, in a format usable by require.js.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
COPYRIGHT.txt
LICENSE.txt
LICENSES.txt
NOTICE.txt
README.md
requirehaml

README.md

requirehaml

A quick-hack javascript that monitors a folder tree for changes in *.haml files, and compiles them into javascript templates that you can import using require.js.

Requires node.js and haml-js (npm install haml)

Usage:

requirehaml my/source/folder my/target/folder

Note: Does not pick up if you create a new file, simply re-issue the command if you create a new file.

Example:

#home
  = title
  %ul.menu
    %li Go Home
    %li Go Back

Becomes:

define(function(){return function(vars){ with(vars||{}) { return "<div id=\"home\">" + title + "<ul class=\"menu\"><li>Go Home</li><li>Go Back</li></ul></div>";}}; });