html-code-gen
html-code-gen is a HTML-code generator. It generates HTML code with given dom(-like) object.
Install
-
nodejs
npm install html-code-gen
var htmlCodeGen = ; -
browser (UMD bundle generated by browserify)
-
global
var htmlCodeGen = windowhtmlCodeGen; -
AMD
var htmlCodeGen = ;
-
Usage
htmlCodeGen;
htmlCodeGen;
Options
-
indent-size
: size of indentdefault:
4
-
indent-char
: char of indent ( space / tab )default:
'space'
-
max-char
: max char num in one line (TODO)default:
80
-
no-format-tag
: tags whose content should not be formatteddefault:
spec.tagTypeMap.structural
-
no-format
: no formatdefault:
false
-
inline-tag
: tags whose content should be inlinedefault:
spec.tagTypeMap.inline
-
formatter
: special formatters { tagName ( script / style ) : formater )default:
{}
-
bool-attribute-value
: hide value of boolean attribute or not ( 'remove' / 'preserve' )default:
'remove'
-
self-close
: should void tags close themeselves with "/" ( 'close' / 'no-close' )default:
'no-close'
-
level
: current leveldefault:
0
Development
-
run test cases
npm run test
-
build for browser
npm run browser