docs: function (element, container, promises, parent, counter) {
  	var node      = element.firstElementChild,
  		component = new Component(parent),
  		i, name, attrs, match, _parent;
  
  	while (node) {
  		name    = node.tagName.toLowerCase();
  		_parent = parent;
  
  		// Replace node element
  		if (components[name]) {
  			make_template_resolver(node, name, container, promises, parent, counter);
  		} else {
  			// Original node element
  			for (i = 0, attrs = node.attributes; i < attrs.length; ++i) {
  				name  = attrs[i].name;
  				match = name.match(EVENT_REGEX);
  
  				if (match) {
  					component.events.push({
  						name    : match[1],
  						handler : attrs[i].value
  					});
  				} else if (directives[name]) {
  					component.directives.push(new Directive(name, cache.resolve_directive(name)));
  				}
  			}
  		}
  
  		if (component.events.keys.length || component.directives.length) {
  			counter.increment();
  
  			component.id      = counter.id;
  			component.element = node;
  
  			_parent = component;
  			container.push(component);
  
  			component = new Component(parent);
  		} else {
  			collect_components_from_element(node, container, promises, parent, counter);
  		}
  
  		node = node.nextElementSibling;
  	}
  }