mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2024-11-22 16:30:11 +00:00
Improve converter.
This commit is contained in:
parent
c96d37b7f1
commit
16cf97e08e
@ -23,7 +23,7 @@ FRESH to JSON Resume conversion routiens.
|
|||||||
|
|
||||||
info: {
|
info: {
|
||||||
label: jrs.basics.label,
|
label: jrs.basics.label,
|
||||||
class: jrs.basics.label,
|
//class: jrs.basics.label,
|
||||||
image: jrs.basics.picture,
|
image: jrs.basics.picture,
|
||||||
brief: jrs.basics.summary
|
brief: jrs.basics.summary
|
||||||
},
|
},
|
||||||
@ -32,8 +32,23 @@ FRESH to JSON Resume conversion routiens.
|
|||||||
email: jrs.basics.email,
|
email: jrs.basics.email,
|
||||||
phone: jrs.basics.phone,
|
phone: jrs.basics.phone,
|
||||||
website: jrs.basics.website
|
website: jrs.basics.website
|
||||||
|
//other: [none]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
meta: jrs.meta,
|
||||||
|
|
||||||
|
// disposition: {
|
||||||
|
// travel: 25,
|
||||||
|
// relocation: true,
|
||||||
|
// authorization: "citizen",
|
||||||
|
// commitment: ["full-time","permanent","contract"],
|
||||||
|
// remote: true,
|
||||||
|
// relocation: {
|
||||||
|
// willing: true,
|
||||||
|
// destinations: [ "Austin, TX", "California", "New York" ]
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
|
||||||
location: {
|
location: {
|
||||||
city: jrs.basics.location.city,
|
city: jrs.basics.location.city,
|
||||||
region: jrs.basics.location.region,
|
region: jrs.basics.location.region,
|
||||||
@ -68,8 +83,8 @@ FRESH to JSON Resume conversion routiens.
|
|||||||
curriculum: edu.courses,
|
curriculum: edu.courses,
|
||||||
url: edu.website || edu.url || null,
|
url: edu.website || edu.url || null,
|
||||||
summary: null,
|
summary: null,
|
||||||
// ???: edu.area, TODO
|
area: edu.area,
|
||||||
// ???: edu.studyType TODO
|
studyType: edu.studyType
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -89,25 +104,18 @@ FRESH to JSON Resume conversion routiens.
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
skills: jrs.skills.map(function(sk){
|
skills: skillsToFRESH( jrs.skills ),
|
||||||
return {
|
|
||||||
name: sk.name,
|
|
||||||
summary: "",
|
|
||||||
level: sk.level,
|
|
||||||
summary: sk.keywords.join(', '),
|
|
||||||
years: null,
|
|
||||||
proof: null
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
|
|
||||||
publications: jrs.publications.map(function(pub){
|
writing: jrs.publications.map(function(pub){
|
||||||
return {
|
return {
|
||||||
title: pub.name,
|
title: pub.name,
|
||||||
publisher: pub.publisher,
|
publisher: pub.publisher,
|
||||||
link: [
|
link: [
|
||||||
{ 'url': pub.website }
|
{ 'url': pub.website }
|
||||||
],
|
],
|
||||||
year: pub.releaseDate
|
year: pub.releaseDate,
|
||||||
|
date: pub.releaseDate,
|
||||||
|
summary: pub.summary
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
|
|
||||||
@ -132,7 +140,9 @@ FRESH to JSON Resume conversion routiens.
|
|||||||
|
|
||||||
interests: jrs.interests,
|
interests: jrs.interests,
|
||||||
|
|
||||||
references: jrs.references
|
references: jrs.references,
|
||||||
|
|
||||||
|
languages: jrs.languages
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -145,13 +155,14 @@ FRESH to JSON Resume conversion routiens.
|
|||||||
|
|
||||||
basics: {
|
basics: {
|
||||||
name: fresh.name,
|
name: fresh.name,
|
||||||
|
label: fresh.info.label,
|
||||||
summary: fresh.info.brief,
|
summary: fresh.info.brief,
|
||||||
website: fresh.info.website,
|
website: fresh.contact.website,
|
||||||
phone: fresh.info.phone,
|
phone: fresh.contact.phone,
|
||||||
email: fresh.info.email,
|
email: fresh.contact.email,
|
||||||
picture: fresh.info.image,
|
picture: fresh.info.image,
|
||||||
location: {
|
location: {
|
||||||
address: fresh.location.address.join('\n'),
|
address: fresh.location.address,
|
||||||
postalCode: fresh.location.code,
|
postalCode: fresh.location.code,
|
||||||
city: fresh.location.city,
|
city: fresh.location.city,
|
||||||
countryCode: fresh.location.country,
|
countryCode: fresh.location.country,
|
||||||
@ -169,6 +180,7 @@ FRESH to JSON Resume conversion routiens.
|
|||||||
work: fresh.employment.history.map(function(emp){
|
work: fresh.employment.history.map(function(emp){
|
||||||
return {
|
return {
|
||||||
company: emp.employer,
|
company: emp.employer,
|
||||||
|
website: emp.url,
|
||||||
position: emp.position,
|
position: emp.position,
|
||||||
startDate: emp.start,
|
startDate: emp.start,
|
||||||
endDate: emp.end,
|
endDate: emp.end,
|
||||||
@ -184,20 +196,12 @@ FRESH to JSON Resume conversion routiens.
|
|||||||
courses: edu.curriculum,
|
courses: edu.curriculum,
|
||||||
startDate: edu.start,
|
startDate: edu.start,
|
||||||
endDate: edu.end,
|
endDate: edu.end,
|
||||||
area: "", // TODO
|
area: edu.area,
|
||||||
studyType: ""
|
studyType: edu.studyType
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
|
|
||||||
skills: fresh.skills.map( function(sk){
|
skills: skillsToJRS( fresh.skills ),
|
||||||
return {
|
|
||||||
name: sk.name,
|
|
||||||
level: sk.level,
|
|
||||||
keywords: [], // TODO
|
|
||||||
//???: sk.years,
|
|
||||||
//???: sk.summary
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
|
|
||||||
volunteer: fresh.service.history.map(function(srv){
|
volunteer: fresh.service.history.map(function(srv){
|
||||||
return {
|
return {
|
||||||
@ -223,10 +227,10 @@ FRESH to JSON Resume conversion routiens.
|
|||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
|
|
||||||
publications: fresh.publications.map(function(pub){
|
publications: fresh.writing.map(function(pub){
|
||||||
return {
|
return {
|
||||||
name: pub.title,
|
name: pub.title,
|
||||||
publisher: "", // TODO
|
publisher: pub.publisher,
|
||||||
releaseDate: pub.date,
|
releaseDate: pub.date,
|
||||||
website: pub.link[0].url,
|
website: pub.link[0].url,
|
||||||
summary: pub.summary
|
summary: pub.summary
|
||||||
@ -235,7 +239,9 @@ FRESH to JSON Resume conversion routiens.
|
|||||||
|
|
||||||
interests: fresh.interests,
|
interests: fresh.interests,
|
||||||
|
|
||||||
references: fresh.references
|
references: fresh.references,
|
||||||
|
|
||||||
|
languages: fresh.languages
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -243,4 +249,42 @@ FRESH to JSON Resume conversion routiens.
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function skillsToFRESH( skills ) {
|
||||||
|
|
||||||
|
return {
|
||||||
|
sets: skills.map(function(set) {
|
||||||
|
return {
|
||||||
|
name: set.name,
|
||||||
|
level: set.level,
|
||||||
|
skills: set.keywords
|
||||||
|
};
|
||||||
|
})
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function skillsToJRS( skills ) {
|
||||||
|
var ret = [];
|
||||||
|
if( skills.sets && skills.sets.length ) {
|
||||||
|
ret = skills.sets.map(function(set){
|
||||||
|
return {
|
||||||
|
name: set.name,
|
||||||
|
level: set.level,
|
||||||
|
keywords: set.skills
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else if( skills.list ) {
|
||||||
|
ret = skills.list.map(function(sk){
|
||||||
|
return {
|
||||||
|
name: sk.name,
|
||||||
|
level: sk.level,
|
||||||
|
keywords: sk.keywords
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
Loading…
Reference in New Issue
Block a user