diff --git a/src/core/jrs-theme.js b/src/core/jrs-theme.js index 6f4993e..ea67890 100644 --- a/src/core/jrs-theme.js +++ b/src/core/jrs-theme.js @@ -48,27 +48,32 @@ Definition of the JRSTheme class. this.render = (thApi && thApi.render) || undefined; this.engine = 'jrs'; - // Create theme formats (HTML and PDF) + // Create theme formats (HTML and PDF). Just add the bare minimum mix of + // properties necessary to allow JSON Resume themes to share a rendering + // path with FRESH themes. this.formats = { html: { outFormat: 'html', files: [ { action: 'transform', render: this.render, - //path: absPath, major: true, - //orgPath: PATH.relative(thFolder, absPath), ext: pathInfo.extname.slice(1), - //title: friendlyName( outFmt ), - //pre: outFmt, - // outFormat: outFmt || pathInfo.name, - //data: FS.readFileSync( absPath, 'utf8' ), + css: null + } + ]}, + pdf: { outFormat: 'pdf', files: [ + { + action: 'transform', + render: this.render, + major: true, + ext: pathInfo.extname.slice(1), css: null } ]} }; } else { - throw { fluenterror: 10 }; + throw { fluenterror: HACKMYSTATUS.missingPackageJSON }; } return this; diff --git a/src/gen/html-pdf-cli-generator.js b/src/gen/html-pdf-cli-generator.js index c5921a5..8158806 100644 --- a/src/gen/html-pdf-cli-generator.js +++ b/src/gen/html-pdf-cli-generator.js @@ -37,7 +37,7 @@ Definition of the HtmlPdfCLIGenerator class. Generate the binary PDF. */ onBeforeSave: function( info ) { - console.log('Called'); + try { var safe_eng = info.opts.pdf || 'wkhtmltopdf'; engines[ safe_eng ].call( this, info.mk, info.outputFile ); diff --git a/src/verbs/build.js b/src/verbs/build.js index 554e51a..634a0e5 100644 --- a/src/verbs/build.js +++ b/src/verbs/build.js @@ -184,7 +184,6 @@ Implementation of the 'generate' verb for HackMyResume. // If targInfo.fmt.files exists, this format is backed by a document. // Fluent/FRESH themes are handled here. - // TODO: Make FRESH and JRS themes render on the same path if( targInfo.fmt.files && targInfo.fmt.files.length ) { theFormat = _fmts.filter( function(fmt) { return fmt.name === targInfo.fmt.outFormat; })[0]; @@ -193,25 +192,19 @@ Implementation of the 'generate' verb for HackMyResume. return theFormat.gen.generate( rez, f, _opts ); } - // Otherwise this is either a) a JSON Resume theme or b) an ad-hoc format - // (JSON, YML, or PNG) that every theme gets "for free". - // else { - // - // theFormat = _fmts.filter( function(fmt) { - // return fmt.name === targInfo.fmt.outFormat; - // })[0]; - // - // var outFolder = PATH.dirname( f ); - // MKDIRP.sync( outFolder ); // Ensure dest folder exists; - // - // // JSON Resume themes have a 'render' method that needs to be called - // if( theme.render ) { - // return renderJRSTheme( f, outFolder, theme ); - // } - // else { - // return theFormat.gen.generate( rez, f, _opts ); - // } - // } + //Otherwise this is an ad-hoc format (JSON, YML, or PNG) that every theme + // gets "for free". + else { + + theFormat = _fmts.filter( function(fmt) { + return fmt.name === targInfo.fmt.outFormat; + })[0]; + + var outFolder = PATH.dirname( f ); + MKDIRP.sync( outFolder ); // Ensure dest folder exists; + + return theFormat.gen.generate( rez, f, _opts ); + } } catch( ex ) { _err( ex );