PageGeneratorPlugin.prototype.generatePagesContent = function()

in packages/docpack-page-generator/lib/plugin.js [231:250]


PageGeneratorPlugin.prototype.generatePagesContent = function(compilation, sources) {
  var plugin = this;
  var targets = this.select(sources).filter(function (source) {
    return 'page' in source;
  });

  targets
    .forEach(function(source) {
      var page = source.page;

      if (page.url in compilation.assets) {
        var msg = page.url + ' page already exist in assets. Check `url` option (and maybe make it more specific)';
        compilation.errors.push(new Error(msg));
        return;
      }

      page.content = plugin.render(compilation, source, targets);
      tools.emitAsset(compilation, page.url, page.content);
    });
};