mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2025-07-04 09:21:05 +01:00
Relocate internal sources to HackMyAPI.
Move internal sources and related tests to: https://github.com/hacksalot/HackMyAPI
This commit is contained in:
@ -1,37 +0,0 @@
|
||||
/**
|
||||
Definition of the JsonYamlGenerator class.
|
||||
@module json-yaml-generator.js
|
||||
@license MIT. Copyright (c) 2015 James Devlin / FluentDesk.
|
||||
*/
|
||||
|
||||
(function() {
|
||||
|
||||
var BaseGenerator = require('./base-generator');
|
||||
var FS = require('fs');
|
||||
var YAML = require('yamljs');
|
||||
|
||||
/**
|
||||
JsonYamlGenerator takes a JSON resume object and translates it directly to
|
||||
JSON without a template, producing an equivalent YAML-formatted resume. See
|
||||
also YamlGenerator (yaml-generator.js).
|
||||
*/
|
||||
|
||||
var JsonYamlGenerator = module.exports = BaseGenerator.extend({
|
||||
|
||||
init: function(){
|
||||
this._super( 'yml' );
|
||||
},
|
||||
|
||||
invoke: function( rez, themeMarkup, cssInfo, opts ) {
|
||||
return YAML.stringify( JSON.parse( rez.stringify() ), Infinity, 2 );
|
||||
},
|
||||
|
||||
generate: function( rez, f, opts ) {
|
||||
var data = YAML.stringify( JSON.parse( rez.stringify() ), Infinity, 2 );
|
||||
FS.writeFileSync( f, data, 'utf8' );
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
}());
|
Reference in New Issue
Block a user