1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-05-03 04:47:07 +01:00

Numerous fixes.

This commit is contained in:
hacksalot
2016-02-13 16:08:45 -05:00
parent 3f8e795c61
commit ca92d41d9e
25 changed files with 6446 additions and 42 deletions

View File

@ -105,7 +105,7 @@ class JRSResume extends AbstractResume
###* Return the resume format. ###
format = () -> 'JRS'
format: () -> 'JRS'

View File

@ -51,7 +51,7 @@ class JRSTheme
files: [{
action: 'transform',
render: this.render,
major: true,
primary: true,
ext: 'html',
css: null
}]
@ -60,7 +60,7 @@ class JRSTheme
files: [{
action: 'transform',
render: this.render,
major: true,
primary: true,
ext: 'pdf',
css: null
}]

View File

@ -31,7 +31,8 @@ module.exports = class HtmlPdfCLIGenerator extends TemplateGenerator
###* Generate the binary PDF. ###
onBeforeSave: ( info ) ->
return info.mk if info.ext != 'html'
#console.dir _.omit( info, 'mk' ), depth: null, colors: true
return info.mk if info.ext != 'html' and info.ext != 'pdf'
safe_eng = info.opts.pdf || 'wkhtmltopdf'
safe_eng = 'phantomjs' if safe_eng == 'phantom'
if _.has engines, safe_eng

View File

@ -7,27 +7,19 @@ Definition of the JsonGenerator class.
BaseGenerator = require './base-generator'
FS = require 'fs'
_ = require 'underscore'
FJCV = require 'fresh-jrs-converter'
###* The JsonGenerator generates a JSON resume directly. ###
###* The JsonGenerator generates a FRESH or JRS resume as an output. ###
module.exports = class JsonGenerator extends BaseGenerator
constructor: () -> super 'json'
keys: ['imp', 'warnings', 'computed', 'filt', 'ctrl', 'index',
'safeStartDate', 'safeEndDate', 'safeDate', 'safeReleaseDate', 'result',
'isModified', 'htmlPreview', 'safe' ]
invoke: ( rez ) ->
# TODO: merge with FCVD
replacer = ( key,value ) -> # Exclude these keys from stringification
if (_.some @keys, (val) -> key.trim() == val)
return undefined
else
value
JSON.stringify rez, replacer, 2
altRez = FJCV[ 'to' + if rez.format() == 'FRESH' then 'JRS' else 'FRESH' ] rez
altRez = FJCV.toSTRING( altRez )
#altRez.stringify()
generate: ( rez, f ) ->
FS.writeFileSync( f, this.invoke(rez), 'utf8' )
FS.writeFileSync f, @invoke(rez), 'utf8'
return

View File

@ -232,7 +232,6 @@ _single = ( targInfo, theme, finished ) ->
# Otherwise this is an ad-hoc format (JSON, YML, or PNG) that every theme
# gets "for free".
else
theFormat = _fmts.filter( (fmt) ->
return fmt.name == targInfo.fmt.outFormat
)[0];