code: function inlineLocalContent() {
        // inline local javascript
        filecontent = filecontent.replace(sre, function(matched, src) {
          if (!incfiles[src]) {
            return matched; // This file wasn't available
          }
          return matched.replace(srcre, '') + '\n' + incfiles[src];
        });
        // now inline local css
        filecontent = filecontent.replace(cre, function(matched, src) {
          var tag;
          if (!incfiles[src]) {
            return matched;
          }
          if (matched.toLowerCase().search('stylesheet') === -1) {
            return matched;
          }
          tag = matched.replace(hrefre, ''); // remove href attribute
          tag = tag.replace(crerel, ''); // remove rel attribute
          tag = tag.replace(cretag, '<style'); // change link to style
          tag = tag.replace(creend, '>'); // remove possible self-closing in style tag
          return tag + '\n' + incfiles[src] + '\n</style>';
        });
        //console.log(filecontent);
        resolve(filecontent);
      }
docs: /* inlineLocalContent processes the HTML file,
  inlining local CSS and JavaScript. The inlined
  content is available in the incfiles object,
  keyed by src or href attribute value.