From 58fc488351626deb83c69d9b5d7d05e99d54c609 Mon Sep 17 00:00:00 2001 From: Sina Atalay Date: Fri, 20 Oct 2023 22:09:52 +0200 Subject: [PATCH] refactor --- rendercv/__main__.py | 2 -- rendercv/data_model.py | 16 ++++++++-------- rendercv/rendering.py | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/rendercv/__main__.py b/rendercv/__main__.py index ceae9a80..eddd53bb 100644 --- a/rendercv/__main__.py +++ b/rendercv/__main__.py @@ -50,8 +50,6 @@ def new(name: Annotated[str, typer.Argument(help="Full name")]): try: environment = Environment( loader=PackageLoader("rendercv", os.path.join("templates")), - trim_blocks=True, - lstrip_blocks=True, ) environment.variable_start_string = "<<" environment.variable_end_string = ">>" diff --git a/rendercv/data_model.py b/rendercv/data_model.py index 5b07b2bf..d02ead5c 100644 --- a/rendercv/data_model.py +++ b/rendercv/data_model.py @@ -349,9 +349,9 @@ class ClassicThemeSectionTitleMargins(BaseModel): class ClassicThemeEntryAreaMargins(BaseModel): """This class stores the margins of entry areas for the classic theme. - For the classic theme, entry areas are [OneLineEntry](../index.md#onelineentry), - [NormalEntry](../index.md#normalentry), and - [ExperienceEntry](../index.md#experienceentry). + For the classic theme, entry areas are [OneLineEntry](../user_guide.md#onelineentry), + [NormalEntry](../user_guide.md#normalentry), and + [ExperienceEntry](../user_guide.md#experienceentry). """ left: LaTeXDimension = Field( @@ -794,7 +794,7 @@ def month_and_year(self) -> Optional[str]: class OneLineEntry(Event): - """This class stores [OneLineEntry](../index.md#onelineentry) information.""" + """This class stores [OneLineEntry](../user_guide.md#onelineentry) information.""" name: str = Field( title="Name", @@ -807,7 +807,7 @@ class OneLineEntry(Event): class NormalEntry(Event): - """This class stores [NormalEntry](../index.md#normalentry) information.""" + """This class stores [NormalEntry](../user_guide.md#normalentry) information.""" name: str = Field( title="Name", @@ -816,7 +816,7 @@ class NormalEntry(Event): class ExperienceEntry(Event): - """This class stores [ExperienceEntry](../index.md#experienceentry) information.""" + """This class stores [ExperienceEntry](../user_guide.md#experienceentry) information.""" company: str = Field( title="Company", @@ -829,7 +829,7 @@ class ExperienceEntry(Event): class EducationEntry(Event): - """This class stores [EducationEntry](../index.md#educationentry) information.""" + """This class stores [EducationEntry](../user_guide.md#educationentry) information.""" institution: str = Field( title="Institution", @@ -878,7 +878,7 @@ def highlight_strings(self) -> list[SpellCheckedString]: class PublicationEntry(Event): - """This class stores [PublicationEntry](../index.md#publicationentry) information.""" + """This class stores [PublicationEntry](../user_guide.md#publicationentry) information.""" title: str = Field( title="Title of the Publication", diff --git a/rendercv/rendering.py b/rendercv/rendering.py index 9942de00..dfa7e038 100644 --- a/rendercv/rendering.py +++ b/rendercv/rendering.py @@ -333,7 +333,7 @@ def render_template(data: RenderCVDataModel, output_path: Optional[str] = None) file_name = data.cv.name.replace(" ", "_") + "_CV.tex" output_file_path = os.path.join(output_folder, file_name) os.makedirs(os.path.dirname(output_file_path), exist_ok=True) - with open(output_file_path, "w", encoding="utf-8") as file: + with open(output_file_path, "w") as file: file.write(output_latex_file) # Copy the fonts directory to the output directory: