2016-01-29 20:23:57 +00:00
|
|
|
###*
|
|
|
|
Definition of the HTMLGenerator class.
|
2016-02-02 18:38:12 +00:00
|
|
|
@module generators/html-generator
|
2016-01-29 20:23:57 +00:00
|
|
|
@license MIT. See LICENSE.md for details.
|
|
|
|
###
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 = class HtmlGenerator extends TemplateGenerator
|
2016-01-29 20:23:57 +00:00
|
|
|
|
2016-02-02 18:38:12 +00:00
|
|
|
constructor: -> super 'html'
|
2016-01-29 20:23:57 +00:00
|
|
|
|
|
|
|
###*
|
|
|
|
Copy satellite CSS files to the destination and optionally pretty-print
|
|
|
|
the HTML resume prior to saving.
|
|
|
|
###
|
|
|
|
onBeforeSave: ( info ) ->
|
|
|
|
if info.outputFile.endsWith '.css'
|
|
|
|
return info.mk
|
|
|
|
if @opts.prettify
|
|
|
|
then HTML.prettyPrint info.mk, this.opts.prettify
|
|
|
|
else info.mk
|