Comparing version 0.1.2 to 0.1.3
{ | ||
"name": "odesza", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Write clean, expressive templates with just HTML and inline JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -11,11 +11,28 @@ # Odesza | ||
## Variables | ||
Variables are passed in when Odesza templates are rendered. Scope is maintained through includes and extends. | ||
## Variables & Statements | ||
Variables are passed in when Odesza templates are rendered. Scope is maintained through includes and extends. You can also treat `${}` as a function statement. | ||
code | ||
```javascript | ||
var vars = { | ||
name = 'world' | ||
title: 'hello world', | ||
names: ['foo', 'bar'] | ||
}; | ||
odesza.render('hello, ${name}', vars); // hello world | ||
odesza.compile('hello', vars); | ||
``` | ||
hello.ode | ||
``` | ||
<title>${title}</title> | ||
<p> | ||
Welcome, ${names.join(',')}! | ||
</p> | ||
``` | ||
output | ||
``` | ||
<title>hello world</title> | ||
<p> | ||
Welcome, foo, bar | ||
</p> | ||
``` | ||
@@ -25,2 +42,10 @@ ## Inline JS | ||
code | ||
```javascript | ||
var vars = { | ||
names: ['wells', 'joe', 'dom'] | ||
}; | ||
odesza.compile('greetings.ode', vars); | ||
``` | ||
greetings.ode | ||
@@ -46,10 +71,2 @@ ```javascript | ||
``` | ||
code | ||
```javascript | ||
var vars = { | ||
names: ['wells', 'joe', 'dom'] | ||
}; | ||
odesza.compile('greetings.ode', vars); | ||
``` | ||
output | ||
@@ -64,3 +81,3 @@ ```html | ||
## Partials | ||
Odesza makes it easy to nest templates within each other. You can include templates as many levels deep as you like. | ||
Odesza makes it easy to nest templates within each other. You can include templates as many levels deep as you like. Variables maintain scope in included files. | ||
@@ -67,0 +84,0 @@ greeting.ode |
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
14828
199