docs: function(dstpath, hbsfile, store, encode, headers) {
          encode = encode || DEFAULT_ENCODE;
  
          var dstfile = path.basename(dstpath);
  
          var s = Array.prototype.slice.call(dstfile.split('.'));
          var extname = s.pop();
          var key= s.pop();
          var env = s.pop();
          var prefix = s.join('.');
  
          var hbspath = path.normalize(path.join(path.dirname(dstpath), hbsfile));
          var data = fs.readFileSync(hbspath, encode);
          var template = handlebars.compile(data);
  
  
          var entrypoint = 'index';
          var clientconf = {};
          if (store.stat.mapping.hasOwnProperty(key)) {
              var conffile = store.stat.mapping[key];
              store.stat.reload(conffile);
              clientconf = store.stat.data[key];
          }
          if (clientconf.hasOwnProperty('entrypoint')) {
              entrypoint = clientconf.entrypoint;
          }
  
          var out = obj.copy(clientconf.requirejs, {});
          if (clientconf.hasOwnProperty('extend') && headers && common.isUAOverride(clientconf, headers) && clientconf.extend.hasOwnProperty('content')) {
              out = obj.copy(clientconf.extend.content, out);
              logger.debug('Override requirehbs2hbsc out:', out);
          }
  
          var context = {
              config: new handlebars.SafeString(JSON.stringify(out, null, '    ')),
              entrypoint: entrypoint,
              name: env,
              key: key
          };
  
          var html = template(context);
  
          ///
          fs.writeFileSync(dstpath, html, encode);
  
          return dstpath;
      }