Kata
Generate HTML from Javascript template literal
Install
$ yarn add kata
Usage
kata relies on DOM APIs. It generates a single DOM node.
html`Sample`
Embedding Javascript
let todos = 'Be nice' 'Smile' html`html` <div> $todos </div>`
Event Handlers
You can include event handlers in your template literal as expressions that evaluate to a function, like this:
{ } html`Click mehtml`<form onsubmit=${}><input name="description"/></form>`html`<button onclick=$console>Do something with this</button>`
Multiple root nodes
Templates the include multiple root nodes generate a DocumentFragment containing those nodes.
html` Header Subheader`