Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

About

A very basic template engine

Resources

License

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.