From ff8f5de20decf4f0d77cedcfc19f2f182320239e Mon Sep 17 00:00:00 2001 From: Sina Atalay Date: Sun, 19 May 2024 17:38:55 +0300 Subject: [PATCH] renderer: update BulletEntry --- rendercv/renderer.py | 16 +++++++++++++--- rendercv/themes/classic/BulletEntry.j2.tex | 8 +------- rendercv/themes/classic/Preamble.j2.tex | 12 ++++++++++++ rendercv/themes/classic/SectionBeginning.j2.tex | 7 ++++++- rendercv/themes/classic/SectionEnding.j2.tex | 4 ++++ .../themes/engineeringresumes/BulletEntry.j2.tex | 8 +------- .../themes/engineeringresumes/Preamble.j2.tex | 12 ++++++++++++ .../engineeringresumes/SectionBeginning.j2.tex | 7 ++++++- .../engineeringresumes/SectionEnding.j2.tex | 4 ++++ rendercv/themes/sb2nov/BulletEntry.j2.tex | 8 +------- rendercv/themes/sb2nov/Preamble.j2.tex | 12 ++++++++++++ rendercv/themes/sb2nov/SectionBeginning.j2.tex | 7 ++++++- rendercv/themes/sb2nov/SectionEnding.j2.tex | 4 ++++ 13 files changed, 82 insertions(+), 27 deletions(-) diff --git a/rendercv/renderer.py b/rendercv/renderer.py index 247c8b5..cffdaff 100644 --- a/rendercv/renderer.py +++ b/rendercv/renderer.py @@ -132,7 +132,9 @@ class LaTeXFile(TemplatedFile): sections: list[tuple[str, list[str], str]] = [] for section in self.cv.sections: section_beginning = self.template( - "SectionBeginning", section_title=section.title + "SectionBeginning", + section_title=section.title, + entry_type=section.entry_type, ) entries: list[str] = [] for i, entry in enumerate(section.entries): @@ -143,10 +145,15 @@ class LaTeXFile(TemplatedFile): section.entry_type, entry=entry, section_title=section.title, + entry_type=section.entry_type, is_first_entry=is_first_entry, ) ) - section_ending = self.template("SectionEnding", section_title=section.title) + section_ending = self.template( + "SectionEnding", + section_title=section.title, + entry_type=section.entry_type, + ) sections.append((section_beginning, entries, section_ending)) return preamble, header, sections @@ -255,7 +262,9 @@ class MarkdownFile(TemplatedFile): sections: list[tuple[str, list[str]]] = [] for section in self.cv.sections: section_beginning = self.template( - "SectionBeginning", section_title=section.title + "SectionBeginning", + section_title=section.title, + entry_type=section.entry_type, ) entries: list[str] = [] for i, entry in enumerate(section.entries): @@ -268,6 +277,7 @@ class MarkdownFile(TemplatedFile): section.entry_type, entry=entry, section_title=section.title, + entry_type=section.entry_type, is_first_entry=is_first_entry, ) ) diff --git a/rendercv/themes/classic/BulletEntry.j2.tex b/rendercv/themes/classic/BulletEntry.j2.tex index 981d14c..d1f5697 100644 --- a/rendercv/themes/classic/BulletEntry.j2.tex +++ b/rendercv/themes/classic/BulletEntry.j2.tex @@ -1,7 +1 @@ -((* if not is_first_entry *)) -\vspace{<>} -((* endif *)) - -\begin{onecolentry} - \textbullet \hspace{3pt} <> -\end{onecolentry} +\item <> diff --git a/rendercv/themes/classic/Preamble.j2.tex b/rendercv/themes/classic/Preamble.j2.tex index 8989b2f..bc59e32 100644 --- a/rendercv/themes/classic/Preamble.j2.tex +++ b/rendercv/themes/classic/Preamble.j2.tex @@ -122,6 +122,18 @@ \end{itemize} } % new environment for highlights +\newenvironment{highlightsforbulletentries}{ + \begin{itemize}[ + topsep=<>, + parsep=<>, + partopsep=0pt, + itemsep=0pt, + leftmargin=10pt + ] +}{ + \end{itemize} +} % new environment for highlights for bullet entries + \newenvironment{onecolentry}{ \begin{adjustwidth}{ diff --git a/rendercv/themes/classic/SectionBeginning.j2.tex b/rendercv/themes/classic/SectionBeginning.j2.tex index b72afb4..c80738d 100644 --- a/rendercv/themes/classic/SectionBeginning.j2.tex +++ b/rendercv/themes/classic/SectionBeginning.j2.tex @@ -1 +1,6 @@ -\section{<>} \ No newline at end of file +\section{<>} + +((* if entry_type == "BulletEntry" *)) +\begin{onecolentry} + \begin{highlightsforbulletentries} +((* endif *)) diff --git a/rendercv/themes/classic/SectionEnding.j2.tex b/rendercv/themes/classic/SectionEnding.j2.tex index e69de29..7e2aaa1 100644 --- a/rendercv/themes/classic/SectionEnding.j2.tex +++ b/rendercv/themes/classic/SectionEnding.j2.tex @@ -0,0 +1,4 @@ +((* if entry_type == "BulletEntry" *)) + \end{highlightsforbulletentries} +\end{onecolentry} +((* endif *)) \ No newline at end of file diff --git a/rendercv/themes/engineeringresumes/BulletEntry.j2.tex b/rendercv/themes/engineeringresumes/BulletEntry.j2.tex index 981d14c..d1f5697 100644 --- a/rendercv/themes/engineeringresumes/BulletEntry.j2.tex +++ b/rendercv/themes/engineeringresumes/BulletEntry.j2.tex @@ -1,7 +1 @@ -((* if not is_first_entry *)) -\vspace{<>} -((* endif *)) - -\begin{onecolentry} - \textbullet \hspace{3pt} <> -\end{onecolentry} +\item <> diff --git a/rendercv/themes/engineeringresumes/Preamble.j2.tex b/rendercv/themes/engineeringresumes/Preamble.j2.tex index 624a75b..a2e6f7d 100644 --- a/rendercv/themes/engineeringresumes/Preamble.j2.tex +++ b/rendercv/themes/engineeringresumes/Preamble.j2.tex @@ -112,6 +112,18 @@ } % new environment for highlights +\newenvironment{highlightsforbulletentries}{ + \begin{itemize}[ + topsep=<>, + parsep=<>, + partopsep=0pt, + itemsep=0pt, + leftmargin=10pt + ] +}{ + \end{itemize} +} % new environment for highlights for bullet entries + \newenvironment{onecolentry}{ \begin{adjustwidth}{ <> + 0.00001 cm diff --git a/rendercv/themes/engineeringresumes/SectionBeginning.j2.tex b/rendercv/themes/engineeringresumes/SectionBeginning.j2.tex index b72afb4..c80738d 100644 --- a/rendercv/themes/engineeringresumes/SectionBeginning.j2.tex +++ b/rendercv/themes/engineeringresumes/SectionBeginning.j2.tex @@ -1 +1,6 @@ -\section{<>} \ No newline at end of file +\section{<>} + +((* if entry_type == "BulletEntry" *)) +\begin{onecolentry} + \begin{highlightsforbulletentries} +((* endif *)) diff --git a/rendercv/themes/engineeringresumes/SectionEnding.j2.tex b/rendercv/themes/engineeringresumes/SectionEnding.j2.tex index e69de29..7e2aaa1 100644 --- a/rendercv/themes/engineeringresumes/SectionEnding.j2.tex +++ b/rendercv/themes/engineeringresumes/SectionEnding.j2.tex @@ -0,0 +1,4 @@ +((* if entry_type == "BulletEntry" *)) + \end{highlightsforbulletentries} +\end{onecolentry} +((* endif *)) \ No newline at end of file diff --git a/rendercv/themes/sb2nov/BulletEntry.j2.tex b/rendercv/themes/sb2nov/BulletEntry.j2.tex index 0bb8929..d1f5697 100644 --- a/rendercv/themes/sb2nov/BulletEntry.j2.tex +++ b/rendercv/themes/sb2nov/BulletEntry.j2.tex @@ -1,7 +1 @@ -((* if not is_first_entry *)) -\vspace{<>} -((* endif *)) - -\begin{onecolentry} - $\circ$ <> -\end{onecolentry} +\item <> diff --git a/rendercv/themes/sb2nov/Preamble.j2.tex b/rendercv/themes/sb2nov/Preamble.j2.tex index b2924d9..ac0e886 100644 --- a/rendercv/themes/sb2nov/Preamble.j2.tex +++ b/rendercv/themes/sb2nov/Preamble.j2.tex @@ -111,6 +111,18 @@ \end{itemize} } % new environment for highlights +\newenvironment{highlightsforbulletentries}{ + \begin{itemize}[ + topsep=<>, + parsep=<>, + partopsep=0pt, + itemsep=0pt, + leftmargin=10pt + ] +}{ + \end{itemize} +} % new environment for highlights for bullet entries + \newenvironment{onecolentry}{ \begin{adjustwidth}{ diff --git a/rendercv/themes/sb2nov/SectionBeginning.j2.tex b/rendercv/themes/sb2nov/SectionBeginning.j2.tex index b72afb4..c80738d 100644 --- a/rendercv/themes/sb2nov/SectionBeginning.j2.tex +++ b/rendercv/themes/sb2nov/SectionBeginning.j2.tex @@ -1 +1,6 @@ -\section{<>} \ No newline at end of file +\section{<>} + +((* if entry_type == "BulletEntry" *)) +\begin{onecolentry} + \begin{highlightsforbulletentries} +((* endif *)) diff --git a/rendercv/themes/sb2nov/SectionEnding.j2.tex b/rendercv/themes/sb2nov/SectionEnding.j2.tex index e69de29..7e2aaa1 100644 --- a/rendercv/themes/sb2nov/SectionEnding.j2.tex +++ b/rendercv/themes/sb2nov/SectionEnding.j2.tex @@ -0,0 +1,4 @@ +((* if entry_type == "BulletEntry" *)) + \end{highlightsforbulletentries} +\end{onecolentry} +((* endif *)) \ No newline at end of file