Class Templater

Defined in: src/util/templater.coffee

Overview

Public: Haml Coffee template compiler.

Instance Method Summary

Constructor Details

::constructor(options, referencer, parser) Source

Public: Construct the templater. Reads all templates and constructs the global template context. options - The options (a Object) referencer - The link type referencer (a Referencer) parser - The biscotto parser (a Parser)

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

Public: Redirect template generation to a callback. file - The file callback Function

Parameters:

  • (Function) fileThe file callback Function

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

Public: Render the given template with the context and the global context object merged as template data. Writes the file as the output filename. template - The template name (a String) context - The context object (a Object) filename - The output file name (a String)

Parameters:

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