ljs-template
Advanced tools
Comparing version 0.1.2 to 0.1.3
{ | ||
"name": "ljs-template", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Lighter Javascript Templates", | ||
@@ -5,0 +5,0 @@ "main": "lib/ljs.js", |
@@ -6,3 +6,5 @@ Lighter Javascript Templates | ||
## Install | ||
## How-To | ||
### Install | ||
``` | ||
@@ -12,3 +14,3 @@ npm install ljs-template --save | ||
## Render | ||
### Render | ||
``` | ||
@@ -22,3 +24,3 @@ var ljs = require('ljs-template'); | ||
It displays: | ||
### It displays: | ||
``` | ||
@@ -28,23 +30,4 @@ Hello Max | ||
## Template sample | ||
## Sample | ||
### Data : | ||
``` | ||
var data = | ||
{ | ||
books: [ | ||
{ | ||
title: "Cravings: Recipes for All the Food You Want to Eat", | ||
authors: ["Chrissy Teigen", "Adeena Sussman"], | ||
price: "$17.85" | ||
}, | ||
{ | ||
title: "Pretty Happy: Healthy Ways to Love Your Body", | ||
authors: ["Kate Hudson"], | ||
price: "$15.89" | ||
} | ||
] | ||
} | ||
``` | ||
### Template : | ||
@@ -56,3 +39,3 @@ ``` | ||
{#each books as book, index #} | ||
{#each books as book #} | ||
<h2>{{_book.title_}}</h2> | ||
@@ -76,2 +59,21 @@ <ul> | ||
### Data : | ||
``` | ||
var data = | ||
{ | ||
books: [ | ||
{ | ||
title: "Cravings: Recipes for All the Food You Want to Eat", | ||
authors: ["Chrissy Teigen", "Adeena Sussman"], | ||
price: "$17.85" | ||
}, | ||
{ | ||
title: "Pretty Happy: Healthy Ways to Love Your Body", | ||
authors: ["Kate Hudson"], | ||
price: "$15.89" | ||
} | ||
] | ||
} | ||
``` | ||
### Render : | ||
@@ -115,3 +117,3 @@ ``` | ||
{% | ||
Javascript code | ||
[javascript] | ||
%} | ||
@@ -122,8 +124,8 @@ ``` | ||
``` | ||
{#var variable_name = [javascript code] #} | ||
{#var [variable] = [javascript] #} | ||
``` | ||
### Display Javascript code : | ||
### Display variable : | ||
``` | ||
{{_[Javascript code]_}} | ||
{{_[variable]_}} | ||
``` | ||
@@ -133,3 +135,3 @@ | ||
``` | ||
{#if [Javascript condition] #} | ||
{#if [condition] #} | ||
@@ -143,3 +145,3 @@ {/else/} | ||
``` | ||
{#each [javascript code] as [value], [key] #} | ||
{#each [map] as [value], [key] #} | ||
{/each/} | ||
@@ -150,4 +152,4 @@ ``` | ||
``` | ||
{#each [javascript code] as [value], [index] #} | ||
{#each [array] as [value], [index] #} | ||
{/each/} | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
145
32432