Elvis is a JavaScript library for creating and building DOM elements programmatically. It does this using native, cross-browser APIs (createElement
et al). Elvis works like a template library, except without having to compile templates from strings. DOM generating code must also be valid JavaScript, and it really shines when used with a transpiled language like CoffeeScript. It is inspired by template languages like Jade and HAML.
var el = elvis;
el(document.body, [
el('nav', el('ul', [
el('li', el('a(href="https://github.com/myme/elvis/blob/master/")', 'Home')),
el('li', el('a(href="https://github.com/myme/elvis/blob/master/news")', 'News')),
...
])),
el('#contents', [
el('span.my-class', 'Hello, World!')
])
]);
number
and boolean
types equal to string
style
attributes directly and with bindings.bindTo
to Backbone Views.get
and .set
for the transform
registration methodsvalue
attributeel.on
Release notes
package.json
and bower.json
version numbers (also in elvis/ + elvis-backbone/)npm run-script build
to update all distribution sourcesgit tag -a <tag>
with the appropriate version numbernpm publish
in both elvis/ + elvis-backbone/