Class: Templater

Defined in: src/util/templater.coffee

Overview

Haml Coffee template compiler.

Instance Method Summary

Constructor Details

::constructor(options, referencer, parser) Source

Construct the templater. Reads all templates and constructs the global template context.

Parameters:

  • (Object) optionsThe options (a Object)
  • (Referencer) referencerThe link type referencer (a Referencer)
  • (Parser) parserThe biscotto parser (a Parser)

Instance Method Details

::redirect(file) Source

Redirect template generation to a callback.

Parameters:

  • (Function) fileThe file callback Function

::render(template, context = {}, filename = '') Source

Render the given template with the context and the global context object merged as template data. Writes the file as the output filename.

Parameters:

  • (String) templateThe template name (a String)
  • (Object) contextThe context object (a Object)
  • (String) filenameThe output file name (a String)