2016-01-27 10:29:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Definition of the HTMLGenerator class.
|
2016-02-02 18:38:12 +00:00
|
|
|
@module generators/html-generator
|
2016-01-27 10:29:26 +00:00
|
|
|
@license MIT. See LICENSE.md for details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
(function() {
|
2016-02-02 18:38:12 +00:00
|
|
|
var FS, HTML, HtmlGenerator, PATH, TemplateGenerator,
|
|
|
|
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
|
|
|
hasProp = {}.hasOwnProperty;
|
2016-01-27 10:29:26 +00:00
|
|
|
|
|
|
|
TemplateGenerator = require('./template-generator');
|
|
|
|
|
|
|
|
FS = require('fs-extra');
|
|
|
|
|
|
|
|
HTML = require('html');
|
|
|
|
|
|
|
|
PATH = require('path');
|
|
|
|
|
|
|
|
require('string.prototype.endswith');
|
|
|
|
|
2016-02-02 18:38:12 +00:00
|
|
|
module.exports = HtmlGenerator = (function(superClass) {
|
|
|
|
extend(HtmlGenerator, superClass);
|
|
|
|
|
|
|
|
function HtmlGenerator() {
|
|
|
|
HtmlGenerator.__super__.constructor.call(this, 'html');
|
|
|
|
}
|
|
|
|
|
2016-01-27 10:29:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Copy satellite CSS files to the destination and optionally pretty-print
|
|
|
|
the HTML resume prior to saving.
|
|
|
|
*/
|
2016-02-02 18:38:12 +00:00
|
|
|
|
|
|
|
HtmlGenerator.prototype.onBeforeSave = function(info) {
|
2016-01-27 10:29:26 +00:00
|
|
|
if (info.outputFile.endsWith('.css')) {
|
|
|
|
return info.mk;
|
|
|
|
}
|
|
|
|
if (this.opts.prettify) {
|
|
|
|
return HTML.prettyPrint(info.mk, this.opts.prettify);
|
|
|
|
} else {
|
|
|
|
return info.mk;
|
|
|
|
}
|
2016-02-02 18:38:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
return HtmlGenerator;
|
|
|
|
|
|
|
|
})(TemplateGenerator);
|
2016-01-27 10:29:26 +00:00
|
|
|
|
|
|
|
}).call(this);
|
2016-02-02 02:14:36 +00:00
|
|
|
|
|
|
|
//# sourceMappingURL=html-generator.js.map
|