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

Start integrating JRS and FRESH rendering paths.

This commit is contained in:
hacksalot
2016-01-08 08:40:19 -05:00
parent 4a2a47f551
commit d6280e6d89
6 changed files with 143 additions and 74 deletions

View File

@ -29,7 +29,7 @@ Error-handling routines for HackMyResume.
err: function( ex, shouldExit ) {
var msg = '', exitCode, log = console.log, showStack = false;
var msg = '', exitCode, log = console.log, showStack = ex.showStack;
// If the exception has been handled elsewhere and shouldExit is true,
// let's get out of here, otherwise silently return.

View File

@ -16,8 +16,7 @@ Definition of the JRSTheme class.
/**
The JRSTheme class is a representation of a JSON Resume
theme asset. See also: FRESHTheme.
The JRSTheme class is a representation of a JSON Resume theme asset.
@class JRSTheme
*/
function JRSTheme() {
@ -41,12 +40,31 @@ Definition of the JRSTheme class.
// Open and parse the theme's package.json file.
var pkgJsonPath = PATH.join( thFolder, 'package.json' );
if( pathExists( pkgJsonPath )) {
var thApi = require( thFolder )
, thPkg = require( pkgJsonPath );
this.name = thPkg.name;
this.render = (thApi && thApi.render) || undefined;
this.engine = 'jrs';
// Create theme formats (HTML and PDF)
this.formats = {
html: { title:'html', outFormat:'html', ext:'html' }
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
}
]}
};
}
else {