1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2024-06-26 05:50:04 +01:00

Move freebie formats out of theme class.

This commit is contained in:
hacksalot 2015-12-30 15:03:26 -05:00
parent 5e51beddf7
commit ccadb0416f
2 changed files with 16 additions and 4 deletions

View File

@ -67,10 +67,6 @@ Definition of the FRESHTheme class.
formatsHash = loadImplicit.call( this );
}
// Add freebie formats every theme gets
formatsHash.json = { title: 'json', outFormat: 'json', pre: 'json', ext: 'json', path: null, data: null };
formatsHash.yml = { title: 'yaml', outFormat: 'yml', pre: 'yml', ext: 'yml', path: null, data: null };
// Cache
this.formats = formatsHash;

View File

@ -218,9 +218,25 @@ Implementation of the 'generate' verb for HackMyResume.
Load the specified theme.
*/
function load_theme( tFolder ) {
// Create a FRESH or JRS theme object
var theTheme = _opts.theme.indexOf('jsonresume-theme-') > -1 ?
new JRSTheme().open(tFolder) : new FluentTheme().open( tFolder );
// Add freebie formats every theme gets
theTheme.formats.json = theTheme.formats.json || {
title: 'json', outFormat: 'json', pre: 'json',
ext: 'json', path: null, data: null
};
theTheme.formats.yml = theTheme.formats.yml || {
title: 'yaml', outFormat: 'yml', pre: 'yml',
ext: 'yml', path: null, data: null
};
// Cache the theme object
_opts.themeObj = theTheme;
// Output a message TODO: core should not log
var numFormats = Object.keys(theTheme.formats).length;
_log( 'Applying '.info + theTheme.name.toUpperCase().infoBold +
(' theme (' + numFormats + ' formats)').info);