Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

sailjs/render

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

26 Commits

Repository files navigation

Sail / Render

The template rendering engine used by Sail.js applications.

Install

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

Usage

Setup Rendering Engine

First, register the engine used to render your templates.

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

Create Templates

Add templates to your HTML document.

<script id="hello-template" type="text/x-mustache-template">
<p>Hello, {{name}}p>
script>

Render Templates

Render a template by passing its ID and any variables to be subtituted into the rendered HTML.

render('hello', { name: 'Dave' });

Compatibility

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) 2012-2013 Jared Hanson <http://jaredhanson.net/>

About

Template rendering engine.

Resources

Readme

License

MIT license

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors