function selectEngine(p) {
    var codePath = path.dirname(p); // remove the file name or child directory in recursive call
    var engine = ss.client.templateEngines[codePath];

    if (engine) {
      return engine;
    }
    if (codePath !== '.') {
      return selectEngine(codePath || '.');
    }
  }
@ngdoc function
@name client.templateEngine:templateEngine#generate
@methodOf client.templateEngine:templateEngine
@param {Object} bundler - Bundler instance for client.
@param {Array} files - Entries for the templates to render markup for.
@param {Function} cb - Callback to receive the string output or Error object.
@description
Generate output (as a string) from Template Engines

    function(out) {
      if (typeof out === 'string') {
      } else {
      // error object
      }
    }