<commit_before>[![build status](https://secure.travis-ci.org/constantology/Templ8.png)](http://travis-ci.org/constantology/Templ8)

#TODO:

- documentation is not yet complete

# Templ8

Templ8 as you can probably guess is a JavaScript template engine, with a Django'ish style of syntax.

It's fast, light weight and unlike a lot of other JavaScript template engines: **Templ8 does not use the JavaScript `with` statement**. This actually makes Templ8 parse templates faster than it would if it did use the `with` statement!

Templ8 does not restrict you to generating HTML. All outputs are strings so if you want to generate HTML, CSS, JavaScript or whatever, the choice is yours...

## Dependencies

Templ8.js only has one dependency [m8.js](/constantology/m8).

**NOTE:**
If you are using Templ8 within a commonjs module, you don't need to require m8 before requiring Templ8 as this is done internally and a reference to **m8** is available as: `Templ8.m8`.

```javascript

   var Templ8 = require( 'Templ8' ),
       m8     = Templ8.m8; // <= reference to m8

// if running in a sandboxed environment remember to:
   m8.x( Object, Array, Boolean, Function, String ); // and/ or any other Types that require extending.

```

See [m8: Extending into the future](/constantology/m8) for more information on working with sandboxed modules.

## Support

Tested to work with nodejs, FF4+, Safari 5+, Chrome 7+, IE9+. Should technically work in any browser that supports [ecma 5]( http://kangax.github.com/es5-compat-table/) without throwing any JavaScript errors.

## API

If all you want to do is swap out values you can use one of the following two smaller template functions.

#### &lt;static&gt; Templ8.format( template`:String`, param1`:String`[, param2`:String`, ..., paramN`:String`] )`:String`<commit_msg>added travis-ci integration<commit_after># Templ8 [![build status](https://secure.travis-ci.org/constantology/Templ8.png)](http://travis-ci.org/constantology/Templ8)

Templ8 as you can probably guess is a JavaScript template engine, with a Django'ish style of syntax.

It's fast, light weight and unlike a lot of other JavaScript template engines: **Templ8 does not use the JavaScript `with` statement**. This actually makes Templ8 parse templates faster than it would if it did use the `with` statement!

Templ8 does not restrict you to generating HTML. All outputs are strings so if you want to generate HTML, CSS, JavaScript or whatever, the choice is yours...

#TODO:

- documentation is not yet complete

## Dependencies

Templ8.js only has one dependency [m8.js](/constantology/m8).

**NOTE:**
If you are using Templ8 within a commonjs module, you don't need to require m8 before requiring Templ8 as this is done internally and a reference to **m8** is available as: `Templ8.m8`.

```javascript

   var Templ8 = require( 'Templ8' ),
       m8     = Templ8.m8; // <= reference to m8

// if running in a sandboxed environment remember to:
   m8.x( Object, Array, Boolean, Function, String ); // and/ or any other Types that require extending.

```

See [m8: Extending into the future](/constantology/m8) for more information on working with sandboxed modules.

## Support

Tested to work with nodejs, FF4+, Safari 5+, Chrome 7+, IE9+. Should technically work in any browser that supports [ecma 5]( http://kangax.github.com/es5-compat-table/) without throwing any JavaScript errors.

## API

If all you want to do is swap out values you can use one of the following two smaller template functions.

#### &lt;static&gt; Templ8.format( template`:String`, param1`:String`[, param2`:String`, ..., paramN`:String`] )`:String`
{'fraction_non_alphanumeric': 0.10322047894302229, 'fraction_numerical': 0.018717313515001378, 'mean_word_length': 4.305109489051095, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6549878', 'n_tokens_mistral': 1088, 'n_tokens_neox': 1038, 'n_words': 470}