Skip to content

Commit 16cf97e

Browse files
committed
Improve converter.
1 parent c96d37b commit 16cf97e

1 file changed

Lines changed: 78 additions & 34 deletions

File tree

src/core/convert.js

Lines changed: 78 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ FRESH to JSON Resume conversion routiens.
2323

2424
info: {
2525
label: jrs.basics.label,
26-
class: jrs.basics.label,
26+
//class: jrs.basics.label,
2727
image: jrs.basics.picture,
2828
brief: jrs.basics.summary
2929
},
@@ -32,8 +32,23 @@ FRESH to JSON Resume conversion routiens.
3232
email: jrs.basics.email,
3333
phone: jrs.basics.phone,
3434
website: jrs.basics.website
35+
//other: [none]
3536
},
3637

38+
meta: jrs.meta,
39+
40+
// disposition: {
41+
// travel: 25,
42+
// relocation: true,
43+
// authorization: "citizen",
44+
// commitment: ["full-time","permanent","contract"],
45+
// remote: true,
46+
// relocation: {
47+
// willing: true,
48+
// destinations: [ "Austin, TX", "California", "New York" ]
49+
// }
50+
// },
51+
3752
location: {
3853
city: jrs.basics.location.city,
3954
region: jrs.basics.location.region,
@@ -68,8 +83,8 @@ FRESH to JSON Resume conversion routiens.
6883
curriculum: edu.courses,
6984
url: edu.website || edu.url || null,
7085
summary: null,
71-
// ???: edu.area, TODO
72-
// ???: edu.studyType TODO
86+
area: edu.area,
87+
studyType: edu.studyType
7388
};
7489
})
7590
},
@@ -89,25 +104,18 @@ FRESH to JSON Resume conversion routiens.
89104
})
90105
},
91106

92-
skills: jrs.skills.map(function(sk){
93-
return {
94-
name: sk.name,
95-
summary: "",
96-
level: sk.level,
97-
summary: sk.keywords.join(', '),
98-
years: null,
99-
proof: null
100-
};
101-
}),
107+
skills: skillsToFRESH( jrs.skills ),
102108

103-
publications: jrs.publications.map(function(pub){
109+
writing: jrs.publications.map(function(pub){
104110
return {
105111
title: pub.name,
106112
publisher: pub.publisher,
107113
link: [
108114
{ 'url': pub.website }
109115
],
110-
year: pub.releaseDate
116+
year: pub.releaseDate,
117+
date: pub.releaseDate,
118+
summary: pub.summary
111119
};
112120
}),
113121

@@ -132,7 +140,9 @@ FRESH to JSON Resume conversion routiens.
132140

133141
interests: jrs.interests,
134142

135-
references: jrs.references
143+
references: jrs.references,
144+
145+
languages: jrs.languages
136146
};
137147
},
138148

@@ -145,13 +155,14 @@ FRESH to JSON Resume conversion routiens.
145155

146156
basics: {
147157
name: fresh.name,
158+
label: fresh.info.label,
148159
summary: fresh.info.brief,
149-
website: fresh.info.website,
150-
phone: fresh.info.phone,
151-
email: fresh.info.email,
160+
website: fresh.contact.website,
161+
phone: fresh.contact.phone,
162+
email: fresh.contact.email,
152163
picture: fresh.info.image,
153164
location: {
154-
address: fresh.location.address.join('\n'),
165+
address: fresh.location.address,
155166
postalCode: fresh.location.code,
156167
city: fresh.location.city,
157168
countryCode: fresh.location.country,
@@ -169,6 +180,7 @@ FRESH to JSON Resume conversion routiens.
169180
work: fresh.employment.history.map(function(emp){
170181
return {
171182
company: emp.employer,
183+
website: emp.url,
172184
position: emp.position,
173185
startDate: emp.start,
174186
endDate: emp.end,
@@ -184,20 +196,12 @@ FRESH to JSON Resume conversion routiens.
184196
courses: edu.curriculum,
185197
startDate: edu.start,
186198
endDate: edu.end,
187-
area: "", // TODO
188-
studyType: ""
199+
area: edu.area,
200+
studyType: edu.studyType
189201
};
190202
}),
191203

192-
skills: fresh.skills.map( function(sk){
193-
return {
194-
name: sk.name,
195-
level: sk.level,
196-
keywords: [], // TODO
197-
//???: sk.years,
198-
//???: sk.summary
199-
};
200-
}),
204+
skills: skillsToJRS( fresh.skills ),
201205

202206
volunteer: fresh.service.history.map(function(srv){
203207
return {
@@ -223,10 +227,10 @@ FRESH to JSON Resume conversion routiens.
223227
};
224228
}),
225229

226-
publications: fresh.publications.map(function(pub){
230+
publications: fresh.writing.map(function(pub){
227231
return {
228232
name: pub.title,
229-
publisher: "", // TODO
233+
publisher: pub.publisher,
230234
releaseDate: pub.date,
231235
website: pub.link[0].url,
232236
summary: pub.summary
@@ -235,12 +239,52 @@ FRESH to JSON Resume conversion routiens.
235239

236240
interests: fresh.interests,
237241

238-
references: fresh.references
242+
references: fresh.references,
243+
244+
languages: fresh.languages
239245

240246
};
241247

242248
}
243249

244250
};
245251

252+
function skillsToFRESH( skills ) {
253+
254+
return {
255+
sets: skills.map(function(set) {
256+
return {
257+
name: set.name,
258+
level: set.level,
259+
skills: set.keywords
260+
};
261+
})
262+
};
263+
}
264+
265+
function skillsToJRS( skills ) {
266+
var ret = [];
267+
if( skills.sets && skills.sets.length ) {
268+
ret = skills.sets.map(function(set){
269+
return {
270+
name: set.name,
271+
level: set.level,
272+
keywords: set.skills
273+
};
274+
});
275+
}
276+
else if( skills.list ) {
277+
ret = skills.list.map(function(sk){
278+
return {
279+
name: sk.name,
280+
level: sk.level,
281+
keywords: sk.keywords
282+
};
283+
});
284+
}
285+
return ret;
286+
}
287+
288+
289+
246290
}());

0 commit comments

Comments
 (0)