diff --git a/rendercv/data_model.py b/rendercv/data_model.py index b729623..03bf7d8 100644 --- a/rendercv/data_model.py +++ b/rendercv/data_model.py @@ -1248,6 +1248,11 @@ class CurriculumVitae(BaseModel): title="Academic Projects", description="The academic project entries of the person.", ) + university_projects: Optional[list[NormalEntry]] = Field( + default=None, + title="University Projects", + description="The university project entries of the person.", + ) personal_projects: Optional[list[NormalEntry]] = Field( default=None, title="Personal Projects", @@ -1375,6 +1380,7 @@ class CurriculumVitae(BaseModel): "Publications": self.publications, "Projects": self.projects, "Academic Projects": self.academic_projects, + "University Projects": self.university_projects, "Personal Projects": self.personal_projects, "Certificates": self.certificates, "Extracurricular Activities": self.extracurricular_activities, @@ -1387,7 +1393,9 @@ class CurriculumVitae(BaseModel): "Programming Skills": self.programming_skills, } + section_order_is_given = True if self.section_order is None: + section_order_is_given = False # If the user didn't specify the section order, then use the default order: self.section_order = list(pre_defined_sections.keys()) if self.custom_sections is not None: @@ -1404,7 +1412,14 @@ class CurriculumVitae(BaseModel): # Create a section for each section name in the section order: if section_name in pre_defined_sections: if pre_defined_sections[section_name] is None: - continue + if section_order_is_given: + raise ValueError( + f'The section "{section_name}" is not found in the CV.' + " Please create the section or delete it from the section" + " order." + ) + else: + continue entry_type = pre_defined_sections[section_name][0].__class__.__name__ entries = pre_defined_sections[section_name] diff --git a/schema.json b/schema.json index a4c4e3a..74ecc26 100644 --- a/schema.json +++ b/schema.json @@ -456,6 +456,19 @@ } ] }, + "university_projects": { + "default": null, + "description": "The university project entries of the person.", + "title": "University Projects", + "allOf": [ + { + "items": { + "$ref": "#/$defs/NormalEntry" + }, + "type": "array" + } + ] + }, "personal_projects": { "default": null, "description": "The personal project entries of the person.", @@ -1676,6 +1689,7 @@ "social_networks": null, "summary": null, "test_scores": null, + "university_projects": null, "website": null, "work_experience": null }, diff --git a/tests/reference_files/John_Doe_CV_pdf_reference.pdf b/tests/reference_files/John_Doe_CV_pdf_reference.pdf index 0c4ba6b..51d3bae 100644 Binary files a/tests/reference_files/John_Doe_CV_pdf_reference.pdf and b/tests/reference_files/John_Doe_CV_pdf_reference.pdf differ diff --git a/tests/reference_files/John_Doe_CV_tex_reference.tex b/tests/reference_files/John_Doe_CV_tex_reference.tex index 9ffcb9e..6204dfc 100644 --- a/tests/reference_files/John_Doe_CV_tex_reference.tex +++ b/tests/reference_files/John_Doe_CV_tex_reference.tex @@ -109,7 +109,7 @@ \LenToUnit{\paperwidth-1.35 cm-0.2 cm+0.05cm}, \LenToUnit{\paperheight-0.675 cm} ){\vtop{{\null}\makebox[0pt][c]{ - \small\color{gray}\textit{Last updated on REPLACETHISWITHTODAY}\hspace{\widthof{Last updated on REPLACETHISWITHTODAY}} + \small\color{gray}\textit{Last updated on November 27, 2023}\hspace{\widthof{Last updated on November 27, 2023}} }}}% }% }% @@ -356,7 +356,7 @@ \vspace{0.07 cm} - A. 1, \textbf{\textit{J. Doe}}, A. 3 + A. \nolinebreak 1, J. \nolinebreak Doe, A. \nolinebreak 3 \vspace{0.07 cm}