Skip to content

Commit

Permalink
About section for templates 6,4,7,5 and 9 (#108)
Browse files Browse the repository at this point in the history
* add about section to template6

* add aboutSection in template4

* add aboutSection in template7

* add aboutSection in template5

* add aboutSection in template9

* format code
  • Loading branch information
ducaale authored and saadq committed Oct 1, 2019
1 parent a8b8beb commit 4fde181
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 0 deletions.
23 changes: 23 additions & 0 deletions app/server/src/generator/templates/template4/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,24 @@ const generator: Template4Generator = {
`
},

aboutSection(basics, heading) {
if (!basics || !basics.summary) {
return ''
}

return source`
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% About
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\\section{${heading || 'About'}}
\\raggedright
${basics.summary}
\\sectionsep
`
},

educationSection(education, heading) {
if (!education) {
return ''
Expand Down Expand Up @@ -370,6 +388,11 @@ function template4(values: SanitizedValues) {
case 'profile':
return generator.profileSection(values.basics)
case 'about':
return generator.aboutSection
? generator.aboutSection(values.basics, headings.about)
: ''
case 'education':
return generator.educationSection(
values.education,
Expand Down
16 changes: 16 additions & 0 deletions app/server/src/generator/templates/template5/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ const generator: Generator = {
`
},

aboutSection(basics, heading) {
if (!basics || !basics.summary) {
return ''
}

return source`
\\section{${heading || 'ABOUT'}}
${basics.summary}
`
},

educationSection(education, heading) {
if (!education) {
return ''
Expand Down Expand Up @@ -245,6 +256,11 @@ function template5(values: SanitizedValues) {
${values.sections
.map(section => {
switch (section) {
case 'about':
return generator.aboutSection
? generator.aboutSection(values.basics, headings.about)
: ''
case 'education':
return generator.educationSection(
values.education,
Expand Down
22 changes: 22 additions & 0 deletions app/server/src/generator/templates/template6/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,23 @@ const generator: Generator = {
`
},

aboutSection(basics, heading) {
if (!basics || !basics.summary) {
return ''
}

return source`
% Chapter: About
% ------------------
\\chap{${heading ? heading.toUpperCase() : 'ABOUT'}}{
${basics.summary}
\\vspace{\\sizefour}
}
`
},

educationSection(education, heading) {
if (!education) {
return ''
Expand Down Expand Up @@ -241,6 +258,11 @@ function template6(values: SanitizedValues) {
case 'profile':
return generator.profileSection(values.basics)
case 'about':
return generator.aboutSection
? generator.aboutSection(values.basics, headings.about)
: ''
case 'education':
return generator.educationSection(
values.education,
Expand Down
16 changes: 16 additions & 0 deletions app/server/src/generator/templates/template7/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ const generator: Template7Generator = {
`
},

aboutSection(basics, heading) {
if (!basics || !basics.summary) {
return ''
}

return source`
\\section{${heading || 'About'}}
\\cvitem{}{${basics.summary}}
`
},

educationSection(education, heading) {
if (!education) {
return ''
Expand Down Expand Up @@ -245,6 +256,11 @@ function template7(values: SanitizedValues) {
${values.sections
.map(section => {
switch (section) {
case 'about':
return generator.aboutSection
? generator.aboutSection(values.basics, headings.about)
: ''
case 'education':
return generator.educationSection(
values.education,
Expand Down
18 changes: 18 additions & 0 deletions app/server/src/generator/templates/template9/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ const generator: Template9Generator = {
`
},

aboutSection(basics, heading) {
if (!basics || !basics.summary) {
return ''
}

return source`
%%% About
%%% ------------------------------------------------------------
\\NewPart{${heading || 'About'}}{}
${basics.summary}
`
},

educationSection(education, heading) {
if (!education) {
return ''
Expand Down Expand Up @@ -320,6 +333,11 @@ function template9(values: SanitizedValues) {
${values.sections
.map(section => {
switch (section) {
case 'about':
return generator.aboutSection
? generator.aboutSection(values.basics, headings.about)
: ''
case 'profile':
return generator.profileSection(values.basics)
Expand Down

0 comments on commit 4fde181

Please sign in to comment.