HackMyResume/dist/generators/html-generator.js

44 lines
958 B
JavaScript
Raw Normal View History

2016-01-27 10:29:26 +00:00
(function() {
2018-02-12 05:05:29 +00:00
/**
Definition of the HTMLGenerator class.
@module generators/html-generator
@license MIT. See LICENSE.md for details.
*/
var FS, HTML, HtmlGenerator, PATH, TemplateGenerator;
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');
2018-02-12 05:05:29 +00:00
module.exports = HtmlGenerator = class HtmlGenerator extends TemplateGenerator {
constructor() {
super('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.
2018-02-12 05:05:29 +00:00
*/
onBeforeSave(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;
}
2018-02-12 05:05:29 +00:00
}
2018-02-12 05:05:29 +00:00
};
2016-01-27 10:29:26 +00:00
}).call(this);
2016-02-02 02:14:36 +00:00
//# sourceMappingURL=html-generator.js.map