From 6c7e425af26824cec9c7a9274925635cd6eea36b Mon Sep 17 00:00:00 2001 From: Sina Atalay Date: Sat, 9 Sep 2023 19:23:41 +0200 Subject: [PATCH] improve components' structure --- rendercv/templates/classic/classic.tex.j2 | 85 ++----------------- .../classic/components/education.tex.j2 | 22 ----- .../classic/components/education_entry.tex.j2 | 19 ----- .../templates/classic/components/entry.tex.j2 | 72 ++++++++++++++++ .../classic/components/experience.tex.j2 | 19 ----- .../components/experience_entry.tex.j2 | 16 ---- .../classic/components/normal_entry.tex.j2 | 25 ------ .../classic/components/one_line_entry.tex.j2 | 12 --- .../classic/components/project.tex.j2 | 19 ----- .../components/section_contents.tex.j2 | 41 +++++++++ 10 files changed, 120 insertions(+), 210 deletions(-) delete mode 100644 rendercv/templates/classic/components/education.tex.j2 delete mode 100644 rendercv/templates/classic/components/education_entry.tex.j2 create mode 100644 rendercv/templates/classic/components/entry.tex.j2 delete mode 100644 rendercv/templates/classic/components/experience.tex.j2 delete mode 100644 rendercv/templates/classic/components/experience_entry.tex.j2 delete mode 100644 rendercv/templates/classic/components/normal_entry.tex.j2 delete mode 100644 rendercv/templates/classic/components/one_line_entry.tex.j2 delete mode 100644 rendercv/templates/classic/components/project.tex.j2 create mode 100644 rendercv/templates/classic/components/section_contents.tex.j2 diff --git a/rendercv/templates/classic/classic.tex.j2 b/rendercv/templates/classic/classic.tex.j2 index 3f06b22..5173900 100644 --- a/rendercv/templates/classic/classic.tex.j2 +++ b/rendercv/templates/classic/classic.tex.j2 @@ -1,8 +1,5 @@ ((# IMPORT MACROS #)) -((* from "components/education_entry.tex.j2" import education_entry with context *)) -((* from "components/experience_entry.tex.j2" import experience_entry with context *)) -((* from "components/normal_entry.tex.j2" import normal_entry with context *)) -((* from "components/one_line_entry.tex.j2" import one_line_entry with context *)) +((* from "components/section_contents.tex.j2" import section_contents with context *)) ((* from "components/header.tex.j2" import header with context *)) \documentclass[10pt, a4paper]{memoir} @@ -99,91 +96,23 @@ <> \section{Education} - -((* for edu in cv.education *)) - <> - ((* if not loop.last *)) - \vspace*{<>} - - ((* endif *)) -((* endfor *)) + <> \section{Work Experience} + <> -((* for work in cv.work_experience *)) - <> - ((* if not loop.last *)) - \vspace*{<>} - - ((* endif *)) -((* endfor *)) - \section{Academic Projects} -((* for academic_project in cv.academic_projects *)) - <> - ((* if not loop.last *)) - \vspace*{<>} - - ((* endif *)) -((* endfor *)) + <> \section{Certificates} -((* for certificate in cv.certificates *)) - <> - ((* if not loop.last *)) - \vspace*{<>} + <> - ((* endif *)) -((* endfor *)) \section{Skills} -((* for skill in cv.skills *)) - <> - ((* if not loop.last *)) - \vspace*{<>} + <> - ((* endif *)) -((* endfor *)) \section{Skills} -((* for skill in cv.skills *)) - <> - ((* if not loop.last *)) - \vspace*{<>} - - ((* endif *)) -((* endfor *)) + <> \end{document} \ No newline at end of file diff --git a/rendercv/templates/classic/components/education.tex.j2 b/rendercv/templates/classic/components/education.tex.j2 deleted file mode 100644 index 9fc349b..0000000 --- a/rendercv/templates/classic/components/education.tex.j2 +++ /dev/null @@ -1,22 +0,0 @@ -((* from "components/highlights.tex.j2" import highlights as print_higlights with context *)) -((* from "components/date_and_location_strings.tex.j2" import date_and_location_strings as print_date_and_locations *)) - -((* macro education(study_type, institution, area, highlights, date_and_location_strings)*)) -((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #)) - ((# width: \textwidth #)) - ((# preamble: first column, second column, third column #)) - ((# first column: p{0.55cm}; constant width, ragged left column #)) - ((# second column: X; variable width, ragged left column #)) - ((# third column: R{<>}; constant widthm ragged right column #)) -\begin{tabularx}{\textwidth}{p{0.55cm} X R{<>}} - \textbf{<>} - & - \textbf{<>}, <> - - <> - & - <> -\end{tabularx} - -\vspace{<>} -((* endmacro *)) \ No newline at end of file diff --git a/rendercv/templates/classic/components/education_entry.tex.j2 b/rendercv/templates/classic/components/education_entry.tex.j2 deleted file mode 100644 index ca97fbe..0000000 --- a/rendercv/templates/classic/components/education_entry.tex.j2 +++ /dev/null @@ -1,19 +0,0 @@ -((* from "components/highlights.tex.j2" import highlights as print_higlights with context *)) -((* from "components/date_and_location_strings.tex.j2" import date_and_location_strings as print_date_and_locations *)) - -((* macro education_entry(study_type, institution, area, highlights, date_and_location_strings)*)) -((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #)) - ((# width: \textwidth #)) - ((# preamble: first column, second column, third column #)) - ((# first column: p{0.55cm}; constant width, ragged left column #)) - ((# second column: X; variable width, ragged left column #)) - ((# third column: R{<>}; constant widthm ragged right column #)) -\begin{tabularx}{\textwidth}{p{0.55cm} X R{<>}} - \textbf{<>} - & - \textbf{<>}, <> - <> - & - <> -\end{tabularx} -((* endmacro *)) \ No newline at end of file diff --git a/rendercv/templates/classic/components/entry.tex.j2 b/rendercv/templates/classic/components/entry.tex.j2 new file mode 100644 index 0000000..68c5fa3 --- /dev/null +++ b/rendercv/templates/classic/components/entry.tex.j2 @@ -0,0 +1,72 @@ +((* from "components/highlights.tex.j2" import highlights as print_higlights with context *)) +((* from "components/date_and_location_strings.tex.j2" import date_and_location_strings as print_date_and_locations *)) + +((* macro education(study_type, institution, area, highlights, date_and_location_strings)*)) +((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #)) + ((# width: \textwidth #)) + ((# preamble: first column, second column, third column #)) + ((# first column: p{0.55cm}; constant width, ragged left column #)) + ((# second column: X; variable width, ragged left column #)) + ((# third column: R{<>}; constant widthm ragged right column #)) +\begin{tabularx}{\textwidth}{p{0.55cm} X R{<>}} + \textbf{<>} + & + \textbf{<>}, <> + + <> + & + <> +\end{tabularx} + +\vspace{<>} +((* endmacro *)) + +((* macro experience(company, position, highlights, date_and_location_strings)*)) +((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #)) + ((# width: \textwidth #)) + ((# preamble: first column, second column #)) + ((# first column:: X; variable width, ragged left column #)) + ((# second column: R{<>}; constant width ragged right column #)) +\begin{tabularx}{\textwidth}{X R{<>}} + \textbf{<>}, <> + <> + & + <> +\end{tabularx} +((* endmacro *)) + +((* macro normal(name, highlights, date_and_location_strings, url, text_url=none)*)) +((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #)) + ((# width: \textwidth #)) + ((# preamble: first column, second column #)) + ((# first column:: X; variable width, ragged left column #)) + ((# second column: R{<>}; constant width ragged right column #)) +\begin{tabularx}{\textwidth}{X R{<>}} + ((* if url is not none *)) + ((* if text_url is not none *)) + ((* set markdown_url = "["+text_url+"]("+ str(url) +")" *)) + \textbf{<>}, <> + ((* elif url|is_markdown *)) + \textbf{<>}, <> + ((* endif *)) + ((* else *)) + \textbf{<>} + ((* endif *)) + <> + & + <> +\end{tabularx} +((* endmacro *)) + +((* macro one_line(name, details, url, text_url=none)*)) +((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #)) + ((# width: \textwidth #)) + ((# preamble: first column, second column #)) + ((# first column:: X; variable width, ragged left column #)) + ((# second column: R{<>}; constant width ragged right column #)) + \setlength{\leftskip}{0.2cm} + \textbf{<>:} <
> + + \vspace{\YMarginBetweenEntries} + \setlength{\leftskip}{0cm} +((* endmacro *)) \ No newline at end of file diff --git a/rendercv/templates/classic/components/experience.tex.j2 b/rendercv/templates/classic/components/experience.tex.j2 deleted file mode 100644 index b597b4c..0000000 --- a/rendercv/templates/classic/components/experience.tex.j2 +++ /dev/null @@ -1,19 +0,0 @@ -((* from "components/highlights.tex.j2" import highlights as print_higlights with context *)) -((* from "components/date_and_location_strings.tex.j2" import date_and_location_strings as print_date_and_locations *)) - -((* macro experience(company, position, highlights, date_and_location_strings)*)) -((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #)) - ((# width: \textwidth #)) - ((# preamble: first column, second column #)) - ((# first column:: X; variable width, ragged left column #)) - ((# second column: R{<>}; constant width ragged right column #)) -\begin{tabularx}{\textwidth}{X R{<>}} - \textbf{<>}, <> - - <> - & - <> -\end{tabularx} - -\vspace{<>} -((* endmacro *)) \ No newline at end of file diff --git a/rendercv/templates/classic/components/experience_entry.tex.j2 b/rendercv/templates/classic/components/experience_entry.tex.j2 deleted file mode 100644 index 7e868b5..0000000 --- a/rendercv/templates/classic/components/experience_entry.tex.j2 +++ /dev/null @@ -1,16 +0,0 @@ -((* from "components/highlights.tex.j2" import highlights as print_higlights with context *)) -((* from "components/date_and_location_strings.tex.j2" import date_and_location_strings as print_date_and_locations *)) - -((* macro experience_entry(company, position, highlights, date_and_location_strings)*)) -((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #)) - ((# width: \textwidth #)) - ((# preamble: first column, second column #)) - ((# first column:: X; variable width, ragged left column #)) - ((# second column: R{<>}; constant width ragged right column #)) -\begin{tabularx}{\textwidth}{X R{<>}} - \textbf{<>}, <> - <> - & - <> -\end{tabularx} -((* endmacro *)) \ No newline at end of file diff --git a/rendercv/templates/classic/components/normal_entry.tex.j2 b/rendercv/templates/classic/components/normal_entry.tex.j2 deleted file mode 100644 index 107a358..0000000 --- a/rendercv/templates/classic/components/normal_entry.tex.j2 +++ /dev/null @@ -1,25 +0,0 @@ -((* from "components/highlights.tex.j2" import highlights as print_higlights with context *)) -((* from "components/date_and_location_strings.tex.j2" import date_and_location_strings as print_date_and_locations *)) - -((* macro normal_entry(name, highlights, date_and_location_strings, url, text_url=none)*)) -((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #)) - ((# width: \textwidth #)) - ((# preamble: first column, second column #)) - ((# first column:: X; variable width, ragged left column #)) - ((# second column: R{<>}; constant width ragged right column #)) -\begin{tabularx}{\textwidth}{X R{<>}} - ((* if url is not none *)) - ((* if text_url is not none *)) - ((* set markdown_url = "["+text_url+"]("+ str(url) +")" *)) - \textbf{<>}, <> - ((* elif url|is_markdown *)) - \textbf{<>}, <> - ((* endif *)) - ((* else *)) - \textbf{<>} - ((* endif *)) - <> - & - <> -\end{tabularx} -((* endmacro *)) \ No newline at end of file diff --git a/rendercv/templates/classic/components/one_line_entry.tex.j2 b/rendercv/templates/classic/components/one_line_entry.tex.j2 deleted file mode 100644 index 940dca1..0000000 --- a/rendercv/templates/classic/components/one_line_entry.tex.j2 +++ /dev/null @@ -1,12 +0,0 @@ -((* macro one_line_entry(name, details, url, text_url=none)*)) -((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #)) - ((# width: \textwidth #)) - ((# preamble: first column, second column #)) - ((# first column:: X; variable width, ragged left column #)) - ((# second column: R{<>}; constant width ragged right column #)) - \setlength{\leftskip}{0.2cm} - \textbf{<>:} <
> - - \vspace{\YMarginBetweenEntries} - \setlength{\leftskip}{0cm} -((* endmacro *)) \ No newline at end of file diff --git a/rendercv/templates/classic/components/project.tex.j2 b/rendercv/templates/classic/components/project.tex.j2 deleted file mode 100644 index 8dbc481..0000000 --- a/rendercv/templates/classic/components/project.tex.j2 +++ /dev/null @@ -1,19 +0,0 @@ -((* from "components/highlights.tex.j2" import highlights as print_higlights *)) -((* from "components/date_and_location_strings.tex.j2" import date_and_location_strings as print_date_and_locations *)) - -((* macro project(name, highlights, datesAndLocations)*)) -((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #)) - ((# width: \textwidth #)) - ((# preamble: first column, second column #)) - ((# first column:: X; variable width, ragged left column #)) - ((# second column: R{<>}; constant width ragged right column #)) -\begin{tabularx}{\textwidth}{X R{<>}} - \textbf{<>} - - <> - & - <> -\end{tabularx} - -\vspace{<>} -((* endmacro *)) \ No newline at end of file diff --git a/rendercv/templates/classic/components/section_contents.tex.j2 b/rendercv/templates/classic/components/section_contents.tex.j2 new file mode 100644 index 0000000..e0aca43 --- /dev/null +++ b/rendercv/templates/classic/components/section_contents.tex.j2 @@ -0,0 +1,41 @@ +((* import "components/entry.tex.j2" as entry with context *)) + +((* macro section_contents(data, entry_type, text_url=none)*)) + ((* for value in data *)) + ((* if entry_type == "education" *)) + <> + ((* elif entry_type == "experience" *)) + <> + ((* elif entry_type == "normal" *)) + <> + ((* elif entry_type == "one_line" *)) + <> + ((* endif *)) + ((* if not loop.last *)) + \vspace*{<>} + + ((* endif *)) + ((* endfor *)) +((* endmacro *))