0.1.8 • Published 12 years ago

basictemplate v0.1.8

Weekly downloads
31
License
-
Repository
github
Last release
12 years ago

#Basic Template v0.1#

A basic template engine.

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

render(view, data, subview)

view is the path the view. data is a javascript object to pass to your view(and subview if you include one). subview is the path to that view.

eg:

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

If you include a subview.

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

To display it 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.

0.1.8

12 years ago

0.1.7

12 years ago

0.1.6

12 years ago

0.1.5

12 years ago

0.1.4

12 years ago

0.1.3

12 years ago

0.1.2

12 years ago

0.1.1

12 years ago

0.1.0

12 years ago