XMLDOCFormatter
A JavaScript Framework for formatting is like XML documents, such as XML, HTML, JSP, PHP and other. Compatible with Closure Compiler.
!!!Development version, not for production yet.
Demo:
Demo of working on site: nodejs html, codewinds html, rbc rss.
Questions, Bugs, Feature requests:
All this you can leave in the appropriate section issues.
Using
In browser:
XMLDOCFormatter can you use in browser for show unformatted text as formatted:
var xmldocformatter = ;xmldocformatter;xmldocformatterclear;
In streams:
XMLDOCFormatter has an internal memory in which it stores information about the last formatted block, whereby it is possible to format streams.
var xmldocformatter = ; var fileReadStream = fs;var fileWriteStream = fs; fileReadStream; fileReadStream;
XMLDOCFormatter is an object, so you can create multiple objects with different options and asynchronously to format multiple streams.
In nodejs:
XMLDOCFormatter can you use in konsole with node.js:
node xmldocformatter.js --source path/to/source.html --output path/to/output.html;
Options
In web:
charsBetweenTags
, chars bettwen symbol > and <, example \r\n.charsForTabs
, chars for tabs, example \t or " ".notPairedTags
, tags without closed tags, as array, example [link, br, img].isMultilineAttributes
, make attributes on multiline.
In node.js:
--source
or-s
, source file or directory for formatting.--output
or-o
, output path for formatted file or directory.--streambuffer
or-sb
, buffer size for streamreader.
Code Style
- Closure compiler compability,
- Using JSDoc for documentations,
- OOP oriented,
- All code checking by JSHint and JSLint.