Skip to content

Instantly share code, notes, and snippets.

@tim-smart
Created March 14, 2010 23:03
Show Gist options
  • Select an option

  • Save tim-smart/332316 to your computer and use it in GitHub Desktop.

Select an option

Save tim-smart/332316 to your computer and use it in GitHub Desktop.
Haml: require './lib/haml'
require.registerExtension '.haml', (content) ->
content: Haml.compile content
(options) ->
compiled: if true is options.optimize then Haml.optimize content else content
Haml.execute compiled, options.context, options.locals
# Sexy templating begins
html: require('mytemplate') {
context: model_instance
optimize: true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment