<commit_before>## JsRender: best-of-breed templating
*Simple and intuitive, powerful and extensible, lightning fast*<br/>
*For templated content in the browser or on Node.js (with Express 4, Hapi and Browserify integration)*<br/>

**JsRender** is a light-weight but powerful templating engine, highly extensible, and optimized for high-performance rendering, without DOM dependency. It is designed for use in the browser or on Node.js, with or without jQuery.

**[JsRender](https://github.com/BorisMoore/jsrender)** and **[JsViews](https://github.com/BorisMoore/jsviews)** together provide the next-generation implementation of the official jQuery plugins *[JQuery Templates](https://github.com/BorisMoore/jquery-tmpl)*, and *[JQuery Data Link](https://github.com/BorisMoore/jquery-datalink)* - and supersede those libraries.

<h3>Documentation and Downloads</h3>
**[Documentation](http://www.jsviews.com)**, **[downloads](http://www.jsviews.com/#download)**, **[samples](http://www.jsviews.com/#samples)** and **[API docs and tutorials](http://www.jsviews.com/#jsrapi)** are available on the **[www.jsviews.com website](http://www.jsviews.com/#jsrender)**.


<h3>JsRender and JsViews</h3>
JsRender is used for data-driven rendering of templates to strings, ready for insertion in the DOM.<br/>
It is also used by the [JsViews](http://www.jsviews.com/#jsviews) platform, which adds data binding to JsRender templates, and provides a fully-fledged MVVM platform for easily creating interactive data-driven single page apps and websites.

<h3>Installation</h3>

 jsrender.js is available from [downloads](http://www.jsviews.com/#download)  on the jsviews.com site. 

Alternatively:
- It can be installed with ***[Bower](http://bower.io/search/?q=jsrender)***, using `$ bower install jsrender` 
- It can be loaded using an AMD script loader, such as RequireJS
- On Node.js, after installing using  `$ npm install jsrender --save`, it can be loaded for server-side rendering (or in the browser using Browserify ) using `var jsrender = require('jsrender');`

<h4><b>jQuery integration</b></h4>
When jQuery is present, JsRender loads as a jQuery plugin and adds `$.views`, `$.templates` and `$.render` to the jQuery namespace object, `$` (or `window.jQuery`).

<h4><b>JsRender without jQuery</b></h4>

When jQuery is not present, JsRender provides its own `jsrender` namespace object, exposed as `window.jsrender`

The `jsrender` namespace provides the same methods/APIs as with jQuery, so if jQuery is not present you can still use all the API examples, by simply writing:

```js
var $ = window.jsrender;

// Now use code as in samples/examples, with $.views... $.templates... $.render...
```

<h4><b>JsRender on Node.js</b></h4>

JsRender can be used to render templates on the server (using Node.js) as well as in the browser. JsRender on Node.js has all the features and APIs of JsRender in the browser, plus some additional ones specific to Node.js.

It also provides built-in *Express*, *Hapi* and *Browserify* integration -- which makes it easy to register templates as simple `.html` files on the file system, and then load and render them either server-side, client-side or both.

**Learn more:** [JsRender Node.js Quickstart](//www.jsviews.com/#jsr-node-quickstart) and [JsRender APIs for Node.js](http://www.jsviews.com/#jsrnode).

**Code samples:** See [JsRender Node Starter](https://github.com/BorisMoore/jsrender-node-starter) for running code examples of Node.js scenarios, including with *Express*, *Hapi* and *Browserify*.

<h2>JsRender Usage</h2>

<h3><i>Define a template</i></h3>

From a string:

```js
var tmpl = $.templates("Name: {{:name}}");
```

From a template declared as markup in a script block:

```html
<script id="myTemplate" type="text/x-jsrender">
Name: {{:name}}
</script>
```
```js
var tmpl = $.templates("#myTemplate");
```

On Node.js, from an .html file containing the template markup:

```js
var $ = require('jsrender'); // returns the jsrender namespace object
var tmpl = $.templates("./templates/myTemplate.html");
```
<a href="http://www.jsviews.com/#d.templates">Learn more...</a>

<h3><i>Render a template</i></h3>

`tmpl.render(object)` (or shortcut form: `tmpl(object)`) renders the template with the object as data context.

`tmpl.render(array)` (or `tmpl(array)`) renders the template once for each item in the array.

```js
var tmpl = $.templates(" Name: {{:name}}<br/> ");

var person = {name: "Jim"};

// Render template for person object
var html = tmpl.render(person); // ready for insertion, e.g $("#container").html(html);

// result: "Name: Jim<br/> "
```

```js
var people = [{name: "Jim"}, {name: "Pedro"}];

// Render template for people array
var html = tmpl.render(people); // ready for insertion...

// result: "Name: Jim<br/> Name: Pedro<br/> "
```
<a href="http://www.jsviews.com/#rendertmpl">Learn more...</a>

<h3><i>Register a named template - and render it</i></h3>

```js
// Register named template - "myTmpl1
$.templates("myTmpl1", "Name: {{:name}}<br/> ");

var person = {name: "Jim"};<commit_msg>Minor readme update - consistent url link style http://<commit_after>## JsRender: best-of-breed templating
*Simple and intuitive, powerful and extensible, lightning fast*<br/>
*For templated content in the browser or on Node.js (with Express 4, Hapi and Browserify integration)*<br/>

**JsRender** is a light-weight but powerful templating engine, highly extensible, and optimized for high-performance rendering, without DOM dependency. It is designed for use in the browser or on Node.js, with or without jQuery.

**[JsRender](https://github.com/BorisMoore/jsrender)** and **[JsViews](https://github.com/BorisMoore/jsviews)** together provide the next-generation implementation of the official jQuery plugins *[JQuery Templates](https://github.com/BorisMoore/jquery-tmpl)*, and *[JQuery Data Link](https://github.com/BorisMoore/jquery-datalink)* - and supersede those libraries.

<h3>Documentation and Downloads</h3>
**[Documentation](http://www.jsviews.com)**, **[downloads](http://www.jsviews.com/#download)**, **[samples](http://www.jsviews.com/#samples)** and **[API docs and tutorials](http://www.jsviews.com/#jsrapi)** are available on the **[www.jsviews.com website](http://www.jsviews.com/#jsrender)**.


<h3>JsRender and JsViews</h3>
JsRender is used for data-driven rendering of templates to strings, ready for insertion in the DOM.<br/>
It is also used by the [JsViews](http://www.jsviews.com/#jsviews) platform, which adds data binding to JsRender templates, and provides a fully-fledged MVVM platform for easily creating interactive data-driven single page apps and websites.

<h3>Installation</h3>

 jsrender.js is available from [downloads](http://www.jsviews.com/#download)  on the jsviews.com site. 

Alternatively:
- It can be installed with ***[Bower](http://bower.io/search/?q=jsrender)***, using `$ bower install jsrender` 
- It can be loaded using an AMD script loader, such as RequireJS
- On Node.js, after installing using  `$ npm install jsrender --save`, it can be loaded for server-side rendering (or in the browser using Browserify ) using `var jsrender = require('jsrender');`

<h4><b>jQuery integration</b></h4>
When jQuery is present, JsRender loads as a jQuery plugin and adds `$.views`, `$.templates` and `$.render` to the jQuery namespace object, `$` (or `window.jQuery`).

<h4><b>JsRender without jQuery</b></h4>

When jQuery is not present, JsRender provides its own `jsrender` namespace object, exposed as `window.jsrender`

The `jsrender` namespace provides the same methods/APIs as with jQuery, so if jQuery is not present you can still use all the API examples, by simply writing:

```js
var $ = window.jsrender;

// Now use code as in samples/examples, with $.views... $.templates... $.render...
```

<h4><b>JsRender on Node.js</b></h4>

JsRender can be used to render templates on the server (using Node.js) as well as in the browser. JsRender on Node.js has all the features and APIs of JsRender in the browser, plus some additional ones specific to Node.js.

It also provides built-in *Express*, *Hapi* and *Browserify* integration -- which makes it easy to register templates as simple `.html` files on the file system, and then load and render them either server-side, client-side or both.

**Learn more:** [JsRender Node.js Quickstart](http://www.jsviews.com/#jsr-node-quickstart) and [JsRender APIs for Node.js](http://www.jsviews.com/#jsrnode).

**Code samples:** See [JsRender Node Starter](https://github.com/BorisMoore/jsrender-node-starter) for running code examples of Node.js scenarios, including with *Express*, *Hapi* and *Browserify*.

<h2>JsRender Usage</h2>

<h3><i>Define a template</i></h3>

From a string:

```js
var tmpl = $.templates("Name: {{:name}}");
```

From a template declared as markup in a script block:

```html
<script id="myTemplate" type="text/x-jsrender">
Name: {{:name}}
</script>
```
```js
var tmpl = $.templates("#myTemplate");
```

On Node.js, from an .html file containing the template markup:

```js
var $ = require('jsrender'); // returns the jsrender namespace object
var tmpl = $.templates("./templates/myTemplate.html");
```
<a href="http://www.jsviews.com/#d.templates">Learn more...</a>

<h3><i>Render a template</i></h3>

`tmpl.render(object)` (or shortcut form: `tmpl(object)`) renders the template with the object as data context.

`tmpl.render(array)` (or `tmpl(array)`) renders the template once for each item in the array.

```js
var tmpl = $.templates(" Name: {{:name}}<br/> ");

var person = {name: "Jim"};

// Render template for person object
var html = tmpl.render(person); // ready for insertion, e.g $("#result").html(html);

// result: "Name: Jim<br/> "
```

```js
var people = [{name: "Jim"}, {name: "Pedro"}];

// Render template for people array
var html = tmpl.render(people); // ready for insertion...

// result: "Name: Jim<br/> Name: Pedro<br/> "
```
<a href="http://www.jsviews.com/#rendertmpl">Learn more...</a>

<h3><i>Register a named template - and render it</i></h3>

```js
// Register named template - "myTmpl1
$.templates("myTmpl1", "Name: {{:name}}<br/> ");

var person = {name: "Jim"};
{'fraction_non_alphanumeric': 0.15405033425088477, 'fraction_numerical': 0.004522217852929611, 'mean_word_length': 4.721597300337458, 'pattern_counts': {'":': 0, '<': 95, '<?xml version=': 0, '>': 95, 'https://': 10, 'lorem ipsum': 0, 'www.': 24, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2780494', 'n_tokens_mistral': 3223, 'n_tokens_neox': 3086, 'n_words': 1122}