Very simple UI descriptions texts parser
var ui_parser = require('nano-ui-parser');
var tree = ui_parser(text);
console.log(tree.toString());
Returns Directive
class tree
- id {String}
- args {String}
- children {Array} of the same class children objects. When object hasn't children its filled with
undefined
value.
Returns array of nodes ids from top-root node to this.
- function callback(node, id, args)
- node {Directive}
- id {String} node id
- args {String} node arguments
# comment
root arguments
// comment
sub-element-1 ererw -> werwer
sub-sub-element-1 there is any text can be arguments
sus-sub-element-2
-- comment
sub-element-2
sub-sub-element-1