Skip to content

Latest commit

 

History

History
70 lines (44 loc) · 1.47 KB

README.md

File metadata and controls

70 lines (44 loc) · 1.47 KB

Sail / Render-Hogan

This module provides an engine for rendering Mustache templates in Sail.js applications. Internally, Hogan.js is used to render templates.

Install

component
$ component install sailjs/render-hogan
volo
$ volo add sailjs/render-hogan

Usage

Register engine with render to process Mustache templates:

render.engine('text/x-mustache-template', hogan());

Compatibility

AMD

Hogan.js does not ship with AMD support. Be sure to include a shim, so that hogan it is usable within an AMD loader.

require.config({
  shim: {
    'hogan': {
      exports: 'Hogan'
    }
  }
});
component

This module uses the AMD format. To include in component builds, use component-amd:

component build -u component-amd

Tests

To run tests in a browser, execute the Make target for the desired browser:

$ make test-chrome
$ make test-firefox
$ make test-safari

Headless tests can be executed directly from a terminal:

$ make test-phantomjs

Credits

License

The MIT License

Copyright (c) 2013 Jared Hanson <http://jaredhanson.net/>