Skip to content
This repository has been archived by the owner on Jul 21, 2022. It is now read-only.

rhyzx/lt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LT

Build Status

Little Template engine with {{Mustache}} specification implemented in javascript.

Installation

$ npm install lt

or download

Syntax

Detail see here

Variables

this is {{name}}

self print {{.}}

Unescape HTML tags

print some html {{&content}}

Sections

Use Non-False values or iterate Non-Empty lists.

{{#items}}
    {{name}}
{{/items}}

Inverted Sections

{{^money}}
    show me the money
{{/money}}

Comments

{{! here is comments }}

Partials

TODO

Lambdas

TODO

Extra Features

Nested path

LT supports nested path like javascript.

this is {{path.to.value}}

Parent path

../ references that use variable of parent context.

{{#child}}
    {{../name}}
{{/child}}

Extremely fast

Morden Mustache-style template engine Benchmark Benchmark

API

lt(source), lt.compile(source)

Compile source(String) to template(Function)

template(data), template.render(data)

Render data(Object/JSON), return String

License

MIT

About

Little Template engine of {{mustache}}

Resources

License

Stars

Watchers

Forks

Packages

No packages published