document-make
A collection of typed functions to create elements with attributes and children
npm i document-make
import * as dm from 'document-make'
const label = dm.label({ for: 'file-input' }, 'Choose a cool picture: ') // makes a label with text
const input = dm.input({ type: 'file', id: 'file-input', name: 'file-input', accept: 'image/png' }) // makes a file input with an id and name
const hr = dm.hr() // makes an hr element
const div = dm.div({}, label, input, hr, 'Great choice!') // makes a div containing the previous elements and textIf you fork this, you should make your changes to builder.mjs and run npm run build to regenerate index.js
It is recommended to install es6-string-html if you are going to edit the source code
- Add test to check formatting of generated code