improve components' structure

This commit is contained in:
Sina Atalay 2023-09-09 19:23:41 +02:00
parent 5a5b6e687f
commit 6c7e425af2
10 changed files with 120 additions and 210 deletions

View File

@ -1,8 +1,5 @@
((# IMPORT MACROS #)) ((# IMPORT MACROS #))
((* from "components/education_entry.tex.j2" import education_entry with context *)) ((* from "components/section_contents.tex.j2" import section_contents 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/header.tex.j2" import header with context *)) ((* from "components/header.tex.j2" import header with context *))
\documentclass[10pt, a4paper]{memoir} \documentclass[10pt, a4paper]{memoir}
@ -99,91 +96,23 @@
<<header(name=cv.name, connections=cv.connections)|indent(4)>> <<header(name=cv.name, connections=cv.connections)|indent(4)>>
\section{Education} \section{Education}
<<section_contents(data = cv.education, entry_type="education")|indent(4)>>
((* for edu in cv.education *))
<<education_entry(
study_type=edu.study_type,
institution=edu.institution,
area=edu.area,
highlights=edu.highlight_strings,
date_and_location_strings=edu.date_and_location_strings
)|indent(4)>>
((* if not loop.last *))
\vspace*{<<design.vertical_margin_between_entries>>}
((* endif *))
((* endfor *))
\section{Work Experience} \section{Work Experience}
<<section_contents(data = cv.work_experience, entry_type="experience")|indent(4)>>
((* for work in cv.work_experience *))
<<experience_entry(
company=work.company,
position=work.position,
highlights=work.highlight_strings,
date_and_location_strings=work.date_and_location_strings
)|indent(4)>>
((* if not loop.last *))
\vspace*{<<design.vertical_margin_between_entries>>}
((* endif *))
((* endfor *))
\section{Academic Projects} \section{Academic Projects}
((* for academic_project in cv.academic_projects *)) <<section_contents(data = cv.academic_projects, entry_type="normal")|indent(4)>>
<<normal_entry(
name=academic_project.name,
highlights=academic_project.highlight_strings,
date_and_location_strings=academic_project.date_and_location_strings,
url=academic_project.markdown_url,
)|indent(4)>>
((* if not loop.last *))
\vspace*{<<design.vertical_margin_between_entries>>}
((* endif *))
((* endfor *))
\section{Certificates} \section{Certificates}
((* for certificate in cv.certificates *)) <<section_contents(data = cv.certificates, entry_type="normal", text_url="Course certificate")|indent(4)>>
<<normal_entry(
name=certificate.name,
highlights=certificate.highlight_strings,
date_and_location_strings=certificate.date_and_location_strings,
url = certificate.url,
text_url = "Course certificate"
)|indent(4)>>
((* if not loop.last *))
\vspace*{<<design.vertical_margin_between_entries>>}
((* endif *))
((* endfor *))
\section{Skills} \section{Skills}
((* for skill in cv.skills *)) <<section_contents(data = cv.skills, entry_type="one_line")|indent(4)>>
<<one_line_entry(
name=skill.name,
details=skill.details,
url = skill.url,
text_url = skill.url
)|indent(4)>>
((* if not loop.last *))
\vspace*{<<design.vertical_margin_between_entries>>}
((* endif *))
((* endfor *))
\section{Skills} \section{Skills}
((* for skill in cv.skills *)) <<section_contents(data = cv.skills, entry_type="one_line")|indent(4)>>
<<one_line_entry(
name=skill.name,
details=skill.details,
url = skill.url,
text_url = skill.url
)|indent(4)>>
((* if not loop.last *))
\vspace*{<<design.vertical_margin_between_entries>>}
((* endif *))
((* endfor *))
\end{document} \end{document}

View File

@ -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{<<design.date_and_location_width>>}; constant widthm ragged right column #))
\begin{tabularx}{\textwidth}{p{0.55cm} X R{<<design.date_and_location_width>>}}
\textbf{<<study_type if study_type is not none>>}
&
\textbf{<<institution>>}, <<area>>
<<print_higlights(highlights)|indent(4)>>
&
<<print_date_and_locations(date_and_location_strings)|indent(4)>>
\end{tabularx}
\vspace{<<design.vertical_margin_between_entries>>}
((* endmacro *))

View File

@ -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{<<design.date_and_location_width>>}; constant widthm ragged right column #))
\begin{tabularx}{\textwidth}{p{0.55cm} X R{<<design.date_and_location_width>>}}
\textbf{<<study_type if study_type is not none>>}
&
\textbf{<<institution>>}, <<area>>
<<print_higlights(highlights)|indent(4)->>
&
<<print_date_and_locations(date_and_location_strings)|indent(4)->>
\end{tabularx}
((* endmacro *))

View File

@ -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{<<design.date_and_location_width>>}; constant widthm ragged right column #))
\begin{tabularx}{\textwidth}{p{0.55cm} X R{<<design.date_and_location_width>>}}
\textbf{<<study_type if study_type is not none>>}
&
\textbf{<<institution>>}, <<area>>
<<print_higlights(highlights)|indent(4)>>
&
<<print_date_and_locations(date_and_location_strings)|indent(4)>>
\end{tabularx}
\vspace{<<design.vertical_margin_between_entries>>}
((* 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{<<design.date_and_location_width>>}; constant width ragged right column #))
\begin{tabularx}{\textwidth}{X R{<<design.date_and_location_width>>}}
\textbf{<<company>>}, <<position>>
<<print_higlights(highlights)|indent(4)->>
&
<<print_date_and_locations(date_and_location_strings)|indent(4)->>
\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{<<design.date_and_location_width>>}; constant width ragged right column #))
\begin{tabularx}{\textwidth}{X R{<<design.date_and_location_width>>}}
((* if url is not none *))
((* if text_url is not none *))
((* set markdown_url = "["+text_url+"]("+ str(url) +")" *))
\textbf{<<name>>}, <<markdown_url|markdown_to_latex>>
((* elif url|is_markdown *))
\textbf{<<name>>}, <<url|markdown_to_latex>>
((* endif *))
((* else *))
\textbf{<<name>>}
((* endif *))
<<print_higlights(highlights)|indent(4)->>
&
<<print_date_and_locations(date_and_location_strings)|indent(4)->>
\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{<<design.date_and_location_width>>}; constant width ragged right column #))
\setlength{\leftskip}{0.2cm}
\textbf{<<name>>:} <<details>>
\vspace{\YMarginBetweenEntries}
\setlength{\leftskip}{0cm}
((* endmacro *))

View File

@ -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{<<design.date_and_location_width>>}; constant width ragged right column #))
\begin{tabularx}{\textwidth}{X R{<<design.date_and_location_width>>}}
\textbf{<<company>>}, <<position>>
<<print_higlights(highlights)|indent(4)>>
&
<<print_date_and_locations(date_and_location_strings)|indent(4)>>
\end{tabularx}
\vspace{<<design.vertical_margin_between_entries>>}
((* endmacro *))

View File

@ -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{<<design.date_and_location_width>>}; constant width ragged right column #))
\begin{tabularx}{\textwidth}{X R{<<design.date_and_location_width>>}}
\textbf{<<company>>}, <<position>>
<<print_higlights(highlights)|indent(4)->>
&
<<print_date_and_locations(date_and_location_strings)|indent(4)->>
\end{tabularx}
((* endmacro *))

View File

@ -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{<<design.date_and_location_width>>}; constant width ragged right column #))
\begin{tabularx}{\textwidth}{X R{<<design.date_and_location_width>>}}
((* if url is not none *))
((* if text_url is not none *))
((* set markdown_url = "["+text_url+"]("+ str(url) +")" *))
\textbf{<<name>>}, <<markdown_url|markdown_to_latex>>
((* elif url|is_markdown *))
\textbf{<<name>>}, <<url|markdown_to_latex>>
((* endif *))
((* else *))
\textbf{<<name>>}
((* endif *))
<<print_higlights(highlights)|indent(4)->>
&
<<print_date_and_locations(date_and_location_strings)|indent(4)->>
\end{tabularx}
((* endmacro *))

View File

@ -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{<<design.date_and_location_width>>}; constant width ragged right column #))
\setlength{\leftskip}{0.2cm}
\textbf{<<name>>:} <<details>>
\vspace{\YMarginBetweenEntries}
\setlength{\leftskip}{0cm}
((* endmacro *))

View File

@ -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{<<design.date_and_location_width>>}; constant width ragged right column #))
\begin{tabularx}{\textwidth}{X R{<<design.date_and_location_width>>}}
\textbf{<<name>>}
<<print_higlights(highlights)|indent(4)>>
&
<<print_date_and_locations(date_and_location_strings)|indent(4)>>
\end{tabularx}
\vspace{<<design.vertical_margin_between_entries>>}
((* endmacro *))

View File

@ -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" *))
<<entry["education"](
study_type=value.study_type,
institution=value.institution,
area=value.area,
highlights=value.highlight_strings,
date_and_location_strings=value.date_and_location_strings
)|indent(4)>>
((* elif entry_type == "experience" *))
<<entry["experience"](
company=value.company,
position=value.position,
highlights=value.highlight_strings,
date_and_location_strings=value.date_and_location_strings
)|indent(4)>>
((* elif entry_type == "normal" *))
<<entry["normal"](
name=value.name,
highlights=value.highlight_strings,
date_and_location_strings=value.date_and_location_strings,
url=value.markdown_url,
text_url=text_url,
)|indent(4)>>
((* elif entry_type == "one_line" *))
<<entry["one_line"](
name=value.name,
details=value.details,
url=value.markdown_url,
text_url=text_url,
)|indent(4)>>
((* endif *))
((* if not loop.last *))
\vspace*{<<design.vertical_margin_between_entries>>}
((* endif *))
((* endfor *))
((* endmacro *))