Jiro Template Language inspired by doT
JavaScript HTML
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
node_modules
test
README.md
jiro.debug.js
jiro.debug.min.js
jiro.express.js
jiro.js
jiro.min.js
package.json
test.html

README.md

JTL or Jiro Template Language

At first this template language is inspired by doT. My goal is to inprove over doT in all posible places:

  • Less in size;
  • Simple to extend;
  • Allow debugging (doT is very weak at this part);
  • Allow more plugin's for improving development;

Installation

	$ npm install jtl

Usage:

  • Direct code insersion {{{code}}}:
	{{
		// any javascript you code
	}}
  • Eval expression {{={statement}}}:
	{{= it.Name}}
  • Conditional statements {{?{condition}}} [{{?? [else condition]}}] {{?}}:
	{{? it.Name == 'Foo'}}
		My name is Foo.
	{{?? it.Name != 'Boo'}}
		My name isn't Boo
	{{?}}

  • Iteration statements {{~ data : k, v}} {{~}} :
	{{~ ['A','B','C'] : k, v}}
		{{=k}} : {{=v}} 
	{{~}}

	{{~ { '0' : 'A', '1' : 'B'} : k, v}}
		{{=k}} : {{=v}} 
	{{~}}
  • Comments {{`{code}}}:
	{{` This is a comment and will be thrown away when rendering... `}}
  • Macros {{# name [: parameters] }} {{#}} {{## name()}}:
	{{# foo : p }}
		<p>{{=p}}</p>
	{{#}}

	{{## foo(it.Name)}}
  • HTML encode content {{!! statement }}
	{{!! it.Name }}
  • Empty if null {{!statement}}:
	{{!it.Name}}	
  • Partials in express {{$ [: data]}}
	{{$ ./views/test.jtl : it }}

Express integration

Comming soon...

Extending

Comming soon...

Debugging

Comming soon...