Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/trix/nano
Simplest Templating Engine
https://github.com/trix/nano
Last synced: 4 months ago
JSON representation
Simplest Templating Engine
- Host: GitHub
- URL: https://github.com/trix/nano
- Owner: trix
- License: mit
- Archived: true
- Created: 2009-07-09T11:31:07.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2020-02-28T12:42:03.000Z (almost 5 years ago)
- Last Synced: 2024-06-22T10:39:57.989Z (6 months ago)
- Language: HTML
- Homepage: http://trix.pl
- Size: 12.7 KB
- Stars: 455
- Watchers: 29
- Forks: 74
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
NANO - Simplest Template Engine
=============================***Basic Usage***
Assuming you have following JSON response:
data = {
user: {
login: "tomek",
first_name: "Thomas",
last_name: "Mazur",
account: {
status: "active",
expires_at: "2009-12-31"
}
}
}you can make:
nano("<p>Hello {user.first_name} {user.last_name}! Your account is <strong>{user.account.status}</strong></p>", data)and you get ready string:
<p>Hello Thomas Mazur! Your account is <strong>active</strong></p>Test page: testPage.html
Simple huh?
***More Advanced Example***
Displaying list of twitter search results (JSONP API)
http://jsfiddle.net/UXZDy/86/