Module: HamlCoffeeAssets::Compiler

Defined in:
lib/haml_coffee_assets/compiler.rb

Overview

Handles compilation of Haml Coffee templates to JavaScript.

Class Method Summary collapse

Class Method Details

.compile(name, source, jst = true) ⇒ String

Compile a Haml Coffee template.

Parameters:

  • name (String)

    the template name

  • source (String)

    the template source code

  • jst (Boolean) (defaults to: true)

    if a JST template should be generated

Returns:

  • (String)

    the compiled template in JavaScript



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/haml_coffee_assets/compiler.rb', line 21

def compile(name, source, jst = true)
  config = HamlCoffeeAssets.config

  runtime.call('HamlCoffeeAssets.compile', name, source, jst,
               config.namespace, config.format, config.uglify, config.basename,
               config.escapeHtml, config.escapeAttributes, config.cleanValue, config.placement, config.dependencies,
               config.customHtmlEscape, config.customCleanValue,
               config.customPreserve, config.customFindAndPreserve,
               config.customSurround, config.customSucceed, config.customPrecede, config.customReference,
               config.preserveTags, config.selfCloseTags,
               config.context, false)
end