diff --git a/cli/resume.go b/cli/resume.go index 656b697..e214e88 100644 --- a/cli/resume.go +++ b/cli/resume.go @@ -34,9 +34,7 @@ import ( "jsonresume/model" "jsonresume/themes" _ "jsonresume/themes/kendall" - _ "jsonresume/themes/kendallfr" _ "jsonresume/themes/stackoverflow" - _ "jsonresume/themes/stackoverflowfr" ) func main() { @@ -45,6 +43,7 @@ func main() { var theme string var err error var outf string + var lang string var f *os.File flag.StringVar(&resume, "resume", "resume.json", "JSON of resume") @@ -53,6 +52,8 @@ func main() { flag.StringVar(&theme, "t", "", "Theme of resume") flag.StringVar(&outf, "out", "-", "Output file") flag.StringVar(&outf, "o", "-", "Output file") + flag.StringVar(&lang, "lang", "", "Force lang") + flag.StringVar(&lang, "l", "", "Force lang") flag.Parse() if outf == "-" { @@ -65,6 +66,9 @@ func main() { if r, err = model.Parse(resume); err != nil { log.Fatal(err) } + if lang != "" { + r.Language = lang + } if t, exists := themes.Themes[theme]; exists { if err = t.Render(r, f); err != nil { diff --git a/model/json.go b/model/json.go index 0f21cd5..1661b0d 100644 --- a/model/json.go +++ b/model/json.go @@ -51,6 +51,7 @@ func (ct *ResumeDate) UnmarshalJSON(b []byte) (err error) { // Resume represent Curriculum Vitae type Resume struct { Title string `json:"title"` + Language string `json:"lang"` Basic Basic `json:"basics"` Work []Work `json:"work"` Volunteer []Volunteer `json:"volunteer"` @@ -66,19 +67,19 @@ type Resume struct { // Basic is the basic information for a resume type Basic struct { - Name string `json:"name"` - Label string `json:"label"` - Image string `json:"image"` - Email string `json:"email"` - Phone string `json:"phone"` - URL string `json:"url"` - Summary string `json:"summary"` - ResumeLocation Location `json:"location"` - Profiles []SocialProfile `json:"profiles"` + Name string `json:"name"` + Label string `json:"label"` + Image string `json:"image"` + Email string `json:"email"` + Phone string `json:"phone"` + URL string `json:"url"` + Summary string `json:"summary"` + Location UserLocation `json:"location"` + Profiles []SocialProfile `json:"profiles"` } // Location is the location details of a resume owner. -type Location struct { +type UserLocation struct { Address string `json:"address"` PostalCode string `json:"postalCode"` City string `json:"city"` @@ -93,35 +94,35 @@ type SocialProfile struct { URL string `json:"url"` } -type JobHighlight struct { +type Highlight struct { Title string `json:"title"` Items []string `json:"items"` } // Work is the work details of the resume owner. type Work struct { - Name string `json:"name"` - WorkLocation string `json:"location"` - Description string `json:"description"` - Position string `json:"position"` - URL string `json:"url"` - StartDate ResumeDate `json:"startDate"` - EndDate ResumeDate `json:"endDate"` - Summary string `json:"summary"` - Highlights []JobHighlight `json:"highlights"` - Keywords []string `json:"keywords"` + Name string `json:"name"` + Location string `json:"location"` + Description string `json:"description"` + Position string `json:"position"` + URL string `json:"url"` + StartDate ResumeDate `json:"startDate"` + EndDate ResumeDate `json:"endDate"` + Summary string `json:"summary"` + Highlights []Highlight `json:"highlights"` + Keywords []string `json:"keywords"` } // Volunteer is the volunteer details of the resume owner. type Volunteer struct { - Organization string `json:"organization"` - Position string `json:"position"` - URL string `json:"url"` - StartDate ResumeDate `json:"startDate"` - EndDate ResumeDate `json:"endDate"` - Summary string `json:"summary"` - Highlights []string `json:"highlights"` - Keywords []string `json:"keywords"` + Organization string `json:"organization"` + Position string `json:"position"` + URL string `json:"url"` + StartDate ResumeDate `json:"startDate"` + EndDate ResumeDate `json:"endDate"` + Summary string `json:"summary"` + Highlights []Highlight `json:"highlights"` + Keywords []string `json:"keywords"` } // Education is the education details of the resume owner. @@ -179,16 +180,16 @@ type Reference struct { // Volunteer is the volunteer details of the resume owner. type Project struct { - Name string `json:"name"` - Description string `json:"description"` - Highlights []string `json:"highlights"` - Keywords []string `json:"keywords"` - StartDate ResumeDate `json:"startDate"` - EndDate ResumeDate `json:"endDate"` - URL string `json:"url"` - Roles []string `json:"roles"` - Entity string `json:"entity"` - Type string `json:"type"` + Name string `json:"name"` + Description string `json:"description"` + Highlights []Highlight `json:"highlights"` + Keywords []string `json:"keywords"` + StartDate ResumeDate `json:"startDate"` + EndDate ResumeDate `json:"endDate"` + URL string `json:"url"` + Roles []string `json:"roles"` + Entity string `json:"entity"` + Type string `json:"type"` } func Parse(f string) (*Resume, error) { diff --git a/themes/kendall/kendall.go b/themes/kendall/kendall.go index ba5b8a5..77459c0 100644 --- a/themes/kendall/kendall.go +++ b/themes/kendall/kendall.go @@ -26,7 +26,6 @@ package kendall import ( - "io/ioutil" "jsonresume/themes" "path" "text/template" @@ -43,25 +42,23 @@ var Theme = themes.Theme{ Name: "kendall", Directory: packageDirectory, Functions: template.FuncMap{ - "iconClass": themes.IconClass, - "formatDateWork": themes.FormatDateWork, - "formatDateEdu": themes.FormatDateEdu, - "formatDatePub": themes.FormatDatePub, - "css": getCSS, - "printcss": getPrintCSS, + "css": getCSS, + "printcss": getPrintCSS, }, - Template: fileTemplate, } func init() { + t, _ := Asset(path.Join(packageDirectory, fileTemplate)) + Theme.Template = string(t) (&Theme).Register() } + func getCSS() string { - r, _ := ioutil.ReadFile(path.Join(packageDirectory, fileCSS)) + r, _ := Asset(path.Join(packageDirectory, fileCSS)) return string(r) } func getPrintCSS() string { - r, _ := ioutil.ReadFile(path.Join(packageDirectory, fileCSSPrint)) + r, _ := Asset(path.Join(packageDirectory, fileCSSPrint)) return string(r) } diff --git a/themes/kendall/resume.template b/themes/kendall/resume.template index 5e1b272..1be4a9b 100644 --- a/themes/kendall/resume.template +++ b/themes/kendall/resume.template @@ -1,10 +1,10 @@ - +
-{{.Basic.Summary}}
{{.Title}}
@@ -101,7 +101,7 @@ {{if .Volunteer -}}{{.StudyType}}
{{end}} @@ -207,7 +214,7 @@ {{if .Skills -}}{{.Reference}}diff --git a/themes/kendallfr/kendallfr.go b/themes/kendallfr/kendallfr.go deleted file mode 100644 index bd015d6..0000000 --- a/themes/kendallfr/kendallfr.go +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2018 Arnaud Ysmal. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -package kendallfr - -import ( - "io/ioutil" - "jsonresume/themes" - "path" - "text/template" -) - -const ( - packageDirectory = "themes/kendallfr" - fileCSS = "style.css" - fileCSSPrint = "print.css" - fileTemplate = "resume.template" -) - -var Theme = themes.Theme{ - Name: "kendallfr", - Directory: packageDirectory, - Functions: template.FuncMap{ - "iconClass": themes.IconClass, - "formatDateWork": themes.FormatDateWorkFR, - "formatDateEdu": themes.FormatDateEduFR, - "formatDatePub": themes.FormatDatePubFR, - "css": getCSS, - "printcss": getPrintCSS, - }, - Template: fileTemplate, -} - -func getCSS() string { - r, _ := ioutil.ReadFile(path.Join(packageDirectory, fileCSS)) - return string(r) -} - -func getPrintCSS() string { - r, _ := ioutil.ReadFile(path.Join(packageDirectory, fileCSSPrint)) - return string(r) -} - -func init() { - (&Theme).Register() -} diff --git a/themes/kendallfr/print.css b/themes/kendallfr/print.css deleted file mode 100644 index a13418f..0000000 --- a/themes/kendallfr/print.css +++ /dev/null @@ -1,91 +0,0 @@ -body { - font-size: .95em; - -webkit-print-color-adjust: exact; -} - -a[href]:after { - content: none !important; -} - -#photo{ - display: none; -} - -.box { - margin-bottom: -10px; -} - -blockquote, -#education, -#awards, -.contact-item, -.publication, -.skills, -.interests { - page-break-inside: avoid; -} - -.col-sm-5{ - width: 40%; - padding: 0 15px; -} - -.col-sm-7{ - width: 60%; - padding: 0 15px; -} - -.skills .col-sm-offset-1, -.interests .col-sm-offset-1{ - margin-top: -10px; - margin-bottom: 5px; -} - -#education { - margin: 0; - margin-bottom: -20px; -} -#awards:before, -#education:before { - background: none; -} - -#awards .description, -#education .description, -.job .details { - border: 1px solid #eee; -} -.publication, -.publication .panel-heading, -.publication .name{ - margin: 0; - padding: 0 5px; - border: none; -} -.publication .panel-body { - padding: 0 10px; - margin: 0; -} - -.badge { - margin: 0; -} - -.list-group-item{ - border: none; - margin: 0; - padding: 5px 15px; -} -.list-group-item:after{ - content: ''; - position: absolute; - top: 8px; - right: 0; - left: -1px; - height: 0; - width: 0; - border: solid transparent; - border-right-color: #999; - border-width: 4px; - pointer-events: none; - } diff --git a/themes/kendallfr/resume.template b/themes/kendallfr/resume.template deleted file mode 100644 index eb5777f..0000000 --- a/themes/kendallfr/resume.template +++ /dev/null @@ -1,299 +0,0 @@ - - - - - - - -CV de {{.Basic.Name}} - - - - - - --- - - diff --git a/themes/kendallfr/style.css b/themes/kendallfr/style.css deleted file mode 100644 index 45c3513..0000000 --- a/themes/kendallfr/style.css +++ /dev/null @@ -1,276 +0,0 @@ -@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800); -@charset "utf-8"; -@-webkit-viewport { width: device-width; } -@-moz-viewport { width: device-width; } -@-ms-viewport { width: device-width; } -@-o-viewport { width: device-width; } -@viewport { width: device-width; } - -body{ - font-family: 'Open Sans', Arial, Tahoma; - font-weight: 400; - color: #363636; - background: #334960; -} -blockquote { - font-size: 1em; -} - -.container{ - margin-top: 80px; - margin-bottom: 15px; - background: #fff; -} - -#photo-header{ - margin-top: -75px; -} -#photo{ - width: 160px; - height: 160px; - border-radius: 50%; - overflow: hidden; - padding: 5px; - background: #334960; - display: inline-block; -} -#photo img{ - width: 150px; - height: 150px; - border-radius: 50%; -} -#text-header h1{ - margin: 0; - padding: 0; - font-size: 1.5em; - font-weight: 700; - text-transform: uppercase; - letter-spacing: -1px; -} -#text-header h1::first-line{ - font-size: 1.5em; - font-weight: 800; - line-height: 1.5em; -} -#text-header h1 span{ - color: #334960; - opacity: 0.7; -} -#text-header h1 sup{ - opacity: 0.5; -} -#text-header:after{ - width: 100%; - height: 3px; - border-bottom: 1px solid #ddd; - margin-top: 15px; - content: ''; - display: block; -} - -.box{ - padding-bottom: 10px; - margin-bottom: 25px; -} -.box h2{ - color: #227c74; - font-size: 1.5em; - font-weight: 700; - text-transform: uppercase; -} - -#awards, -#education{ - margin-top: 20px; - margin-bottom: 0; - position: relative; - padding: 1em 0; - list-style: none; -} -#awards:before, -#education:before { - width: 5px; - height: 100%; - position: absolute; - left: 35px; - top: 0; - content: ' '; - display: block; - background: #32475c; - background: -moz-linear-gradient(top, #ffffff 0%, #32475c 7%, #32475c 89%, #ffffff 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(7%,#32475c), color-stop(89%,#32475c), color-stop(100%,#ffffff)); - background: -webkit-linear-gradient(top, #ffffff 0%,#32475c 7%,#32475c 89%,#ffffff 100%); - background: -o-linear-gradient(top, #ffffff 0%,#32475c 7%,#32475c 89%,#ffffff 100%); - background: -ms-linear-gradient(top, #ffffff 0%,#32475c 7%,#32475c 89%,#ffffff 100%); - background: linear-gradient(to bottom, #ffffff 0%,#32475c 7%,#32475c 89%,#ffffff 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ffffff',GradientType=0 ); -} -#awards li, -#education li{ - width: 100%; - z-index: 2; - position: relative; - float: left; -} -#awards .year, -#education .year{ - width: 14%; - background: #fff; - padding: 10px; - font-weight: 700; - display: inline-block; -} -#awards .description, -#education .description{ - width: 83%; - display: inline-block; - background: #eee; - margin-bottom: 10px; - position: relative; - padding: 10px; - border-bottom: 1px solid #ccc; - border-right: 1px solid #ccc; -} -#awards .description:after, -#education .description:after { - content: ''; - position: absolute; - top: 15px; - right: 0; - left: -16px; - height: 0; - width: 0; - border: solid transparent; - border-right-color: #eee; - border-width: 8px; - pointer-events: none; -} -#awards .description h3, -#education .description h3{ - font-size: 1.2em; - margin: 0; - padding: 0; - font-weight: 700; -} -#awards .description p, -#education .description p{ - margin-top: 5px; - padding: 0; -} - -.job{ - margin-bottom: 15px; -} -.job .details { - margin-left: 3%; - width: 95%; - padding: 10px; - margin-bottom: 10px; - background: #eee; - border-bottom: 1px solid #ccc; - border-right: 1px solid #ccc; -} -.job .where{ - font-size: 1.2em; - font-weight: bold; -} -.job .year{ - opacity: 0.7; -} -.job .profession{ - font-size: 1.2em; - font-weight: bold; -} -.job .description{ - line-height: 1.5em; -} -.job .highlights{ - padding: 5px 0; - font-weight: bold; -} -.job .job-details { - padding-left: 5%; - width: 100%; -} -.publication { - margin-bottom: 0; -} -.publication .name{ - font-size: 1em; - font-weight: bold; -} -.publication .year{ - opacity: 0.7; -} -.publication p{ - margin: 0; - padding-top: 10px; -} - -.contact-item{ - width: 100%; - float: left; -} -.contact-item .icon{ - padding: 10px; - border-right: 1px solid #ccc; - border-bottom: 1px solid #ccc; - color: #32475c; - background: #eee; -} -.contact-item:last-child .icon{ - border-bottom: none; -} -.contact-item .title{ - width: 80%; - width: calc(100% - 55px); - font-weight: 700; - opacity: 0.9; -} -.contact-item .title.only{ - margin-top: 10px; -} -.contact-item .description{ - width: 80%; - width: calc(100% - 55px); - color: #334960; -} - -.item-interests, -.item-skills{ - height: 30px; - color: #334960; - padding: 5px 10px; - margin-bottom: 5px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - font-size: 1.1em; - font-weight: 600; -} -.interest, -.skill{ - color: #fff; - display: inline-block; - margin-right: 5px; - margin-bottom: 5px; - padding: 5px 10px; - background: #32475c; - position: relative; - font-size: .85em; -} -.skill-level { - background-color: #227c74; - border-radius: 4px; - color: #fff; - padding: 1px 8px; - font-size: .75em; - position: absolute; - margin: 1px 10px; -} - -#language-skills .skill{ - margin: 10px 0; - padding-bottom: 10px; - border-bottom: 1px solid #eee; -} diff --git a/themes/stackoverflow/resume.template b/themes/stackoverflow/resume.template index a2ca59a..b2318b3 100644 --- a/themes/stackoverflow/resume.template +++ b/themes/stackoverflow/resume.template @@ -1,5 +1,5 @@ - + @@ -27,22 +27,22 @@----- - {{if .Basic.Image -}} --- -- {{- end}} ---{{.Basic.Name}}
-
{{if .Basic.Label}}{{.Basic.Label}}{{- end}}--- {{if .Basic.Summary -}} - ---- {{- end}} - {{if .Work -}} - -À propos
-{{.Basic.Summary}}
--- {{- end}} - {{if .Awards -}} - -Expérience Professionnelle
- {{range .Work -}} --- {{- end}} -----{{.Name}}- {{if .URL -}} -- {{.URL}} -- {{- end}} -{{formatDateWork .StartDate}} – {{formatDateWork .EndDate}}-----{{.Position}}-- {{.Summary -}} - {{if .Highlights -}} - --- {{range .Highlights -}} -
- {{- end}} -- - {{.Title}} - {{if .Items -}} -
- {{- end}} -- {{range .Items}}
- {{- end}} -- {{.}}
{{end}} --- {{- end}} - {{if .Volunteer -}} - -Récompenses
-- {{range .Awards -}} -
-- -
- {{- end}} -{{formatDatePub .Date}}---{{.Awarder}}
-{{.Title}}
-{{.Summary}}
--- {{- end}} -Bénévolat
- {{range .Volunteer -}} --- {{- end}} -----{{.Organization}}- {{if .URL -}} -- {{.URL}} -- {{- end}} -{{formatDateWork .StartDate}} – {{formatDateWork .EndDate}}-----{{.Position}}-- {{.Summary -}} - {{if .Highlights -}} - --- {{range .Highlights -}} -
- {{- end}} -- {{.}}
- {{- end}} -- ---- {{if .Education -}} - -Contact
- {{if .Basic.ResumeLocation.City -}} --- {{- end}} - {{if .Basic.Phone -}} -- {{if .Basic.ResumeLocation.Address}}{{.Basic.ResumeLocation.Address}}{{- end}} -{{.Basic.ResumeLocation.City}}{{if .Basic.ResumeLocation.Region}}, {{.Basic.ResumeLocation.Region}}{{- end}}{{if .Basic.ResumeLocation.PostalCode}} {{.Basic.ResumeLocation.PostalCode}}{{- end}}{{if .Basic.ResumeLocation.CountryCode}} {{.Basic.ResumeLocation.CountryCode}}{{- end}}--- {{- end}} - {{if .Basic.Email -}} --{{.Basic.Phone}}--- {{- end}} - {{if .Basic.URL -}} -- --- {{- end}} - {{range .Basic.Profiles -}} - - {{- end}} -- --- {{- end}} - {{if .Skills -}} - -Formation
-- {{range .Education -}} -
-- -
- {{- end}} -{{formatDateEdu .StartDate}} {{formatDateEdu .EndDate}}---{{.Institution}}
- {{if .StudyType}}{{.StudyType}}
{{end}} -{{.Area}}
- {{if .GPA -}} -- GPA: {{.GPA}} -
- {{- end}} - {{if .Courses -}} -Courses-- {{range .Courses -}} -
- {{- end}} -- {{.}}
- {{- end}} --- {{- end}} - {{if .Publications -}} - -Compétences
- {{range .Skills -}} --- {{- end}} -- {{.Name}} - {{if .Level}}{{.Level}}{{- end}} --- {{range .Keywords -}} - {{.}} - {{- end}} ---- {{- end}} - {{if .Languages -}} - -Publications
- {{range .Publications -}} --- {{- end}} ---{{.Name}}-- {{if .Publisher -}} --{{.Publisher}}- {{- end}} -{{formatDatePub .ReleaseDate}}- {{if .URL -}} -- {{.URL}} -- {{- end}} - {{if .Summary -}} -{{.Summary}}
- {{- end}} --- {{- end}} - {{if .Interests -}} - -Langues
-- {{range .Languages -}} -
-- {{.Language}}{{.Fluency}}
- {{- end}} --- {{- end}} - {{if .References -}} -Intérêts
- {{range .Interests -}} --- {{- end}} -- {{.Name -}} --- {{range .Keywords -}} - {{.}} - {{- end}} ---- {{- end}} -Références
- {{range .References -}} --{{.Reference}}- -
- {{- end}} -
{{$p.Description}}
{{$v.Summary}}
{{$a.Summary}}
{{$w.Summary}}
{{$p.Description}}
{{$v.Summary}}
{{$a.Summary}}
{{$p.Summary}}
“ {{.Reference}} ”{{end}} - {{if .Name}}