nano-ui-parser
Very simple UI descriptions texts parser
Usage
var ui_parser = ; var tree = ; console;
function parse_tree(text)
Returns Directive
class tree
class: Directive
- id {String}
- args {String}
- children {Array} of the same class children objects. When object hasn't children its filled with
undefined
value.
tree.getPath()
Returns array of nodes ids from top-root node to this.
tree.enumChildren(callback)
- function callback(node, id, args)
- node {Directive}
- id {String} node id
- args {String} node arguments
About UI files
# 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