A very basic template engine
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
templates/basic
tests
.gitignore
.npmignore
.travis.yml
LICENSE.txt
basictemplate.js
package.json
php.js
readme.md

readme.md

build status #Basic Template v0.1.8#

A basic template engine.

A main view and data. Optionally a subview. uses {variable} styles.

Setup

To set up Basic Template on your Node.js server use npm.

    npm install basictemplate

Basic Usage

var basictemplate = require('basictemplate');
basictemplate.render('./view.bt', {hello: 'World'}, function(err, html)
{
	console.log(err);
	console.log(html);
});

If you include a subview.

var basictemplate = require('basictemplate');
basictemplate.render_sub('./view.bt', './subview.bt', {hello: 'World'}, function(err, html)
{
	console.log(err);
	console.log(html);
});

To display a subview within the view, use {{_SUBVIEW}}

{variable} = escaped to HTML entities

{{variable}} = unescaped

##error:##

error is an object.

type: the type of error. If it's a file system error, type will be file, and then another variable called file will contain the filesystem error object, if you want to analyze it.

##Used by: ##

MailKit - https://github.com/keverw/mailkit

If you're using Basic Template, let me know! @keverw