docs: function (res, options, callback) {
              var self = this;
              var req = res.req;
              var done = callback;
              var opts = options || {};
              // 函数参数处理
              // support callback function as second arg
              if (typeof opts === 'function') {
                  done = opts;
                  opts = {};
              }
              // default callback to respond
              done = done || function (err, str) {
                  if (err) return req.next(err);
                  res.send(str);
              };
  
              // 所有对res.locals的处理
              var widgetLoader = new WidgetLoader(res.locals, this.module, Resource);
              var layoutLoader = new LayoutLoader(res.locals, this.module, Resource);
              var scriptLoader = new ScriptLoader(res.locals, Resource);
              var styleLoader = new StyleLoader(res.locals, Resource);
  
              logger.trace(res.locals);
              res.render(this.pageRenderID, {data: opts}, function (err, html) {
                  if (err) {
                      return req.next(err);
                  }
                  if (html) {
                      // 先渲染layout中的块
                      html = layoutLoader.render(html);
  
                      // 输出脚本和样式
                      var scripts = layoutLoader.scripts().concat(widgetLoader.scripts()).concat([self.scriptPath()]);
                      var styles = layoutLoader.styles().concat(widgetLoader.styles()).concat([self.stylePath()]);
  
                      // var nestedScriptHtml = scriptLoader.outputNestedScriptsOld(html);
                      var result = scriptLoader.outputNestedScripts(html);
                      var nestedScriptHtml = result.script;
                      html = result.html;
                      var scriptHtml = scriptLoader.outputScripts(scripts, Conf.mergeJs);
                      var styleHtml = styleLoader.outputStyles(styles, Conf.mergeCss);
  
                      // 移除scriptLoader的注释
                      // html = scriptLoader.removeAnnotation(html);
                      html = TemplateHelper.appendToHeadBottom(html, styleHtml);
                      html = TemplateHelper.appendToBodyBottom(html, scriptHtml + nestedScriptHtml);
                      
                      // 替换.js文件为min.js
                      if (extList.length > 0) {
                          html = scriptLoader.replaceWithMin(html, extList, whiteList);
                      }
                      /*
                      if (useMinJs) {
                          html = scriptLoader.replaceWithMinOld(html, 'js', whiteListJs);
                      }
                      if (useMinCss) {
                          html = scriptLoader.replaceWithMinOld(html, 'css', whiteListCss);
                      }
                      */
                  }
                  if (done) {
                      done(err, html);
                  }
  
                  logger.info('finish rendering page: ', self.pageID);
              });
          }