vtree-kup
vtree-kup provides CoffeeKup-like DSL for building virtual-dom tree.
Installation
$ npm install vtree-kup
Usage
Basic
vtreeKup = require 'vtree-kup' = vtreeKup kh1 'Counter' kp countervalue kbutton : -> counterincrement 'Increment'
Selectors
A string is used to specify classes and an id for the element if it is the first argument and valid as a selector.
kh1 '.title#counter-title''Counter'
Inline elements
kdiv 'This is an'-> kspan '.is-important' 'important''element'
Insert virtual-dom nodes
kh1 'Counter'# #$add accepts both an array and a node k$add 'p'Stringcountervaluekbutton : -> counterincrement 'Increment'
Todo
- Add new tags (for custom elements)
- Namespace support (SVG, MathML)
- Browser tests