HTML View
HTML view template string function.
This is a convenience function for creating HTML with Javascript.
Install
In the browser, grab one of the files from the dist folder in this repository. You will also need an escape function such as the one found in haka.
With NodeJS install it from NPM, escape function is included:
npm i htmlview
Usage
const h = require('htmlview')
const html = h`<div>hello</div>`
const html = h`<div>hello ${5}</div>`
const html = h`<div>hello ${[ '1', '2', '3']}</div>`
const html = h`<div>hello ${[ '1', '2', '3'].join(',')}</div>`
const html = h`<div>hello ${() => 'bye'}</div>`
const html = h`<div>hello${() => {
if (project.done) return '<b>bye</b>'
}}</div>`
MIT Licensed. Enjoy!