HTML is The BEST JavaScript templating language EVER
HTML was heavily inspired by Jade from Visionmedia
Features
- HTML is valid (X) HTML 4.01 and HTML5!
- HTML is Insanely Fast !
- Safari, Internet Explorer, Chrome, and Firefox are all specifically optimized for rendering HTML!
- HTML is highly portable ( Even tested it in Microsoft Frontpage and Macromedia Dreamweaver )
- HTML is
< 4 bytes
in size! - It's not possible to write logic in HTML
- I'm pretty annoyed I had to build this.
Note: I have no fucking clue how to successfully use Weld or Plates.
Core Concepts
- You already know HTML
- JSON data automatically maps to CSS classes
- You cannot define any custom logic or maps with HTML
- That's it.
Examples
Rendering basic data
var html = ;console;
name placeholder
outputs:
Bob
Rendering an Object
var html = ; var user = user: name: "Bob" email: "bob@bob.com" ; console;
name placeholder email placeholder
outputs:
Bob bob@bob.com
Rendering an Array of Objects ( collection )
var html = ; var users = name: "Bob" email: "bob@bob.com" name: "Marak" email: "marak@marak.com"; console;
name placeholder email placeholder
outputs:
Bob bob@bob.com Marak marak@marak.com
Rendering a Partial with a CSS Selector
Set the context of where the render should occur based on an arbitrary CSS selector.
var html = ;console;
name placeholder name placeholder
outputs:
Bob
XML Node Attributes
var html = ; var data = 'link': "The big website" 'link.href': "http://big.vc" ; console;
outputs:
The big website