diff --git a/examples/John_Doe_ClassicTheme_CV.yaml b/examples/John_Doe_ClassicTheme_CV.yaml index b8638939..def856e9 100644 --- a/examples/John_Doe_ClassicTheme_CV.yaml +++ b/examples/John_Doe_ClassicTheme_CV.yaml @@ -1,4 +1,3 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/rendercv/rendercv/refs/tags/v2.2/schema.json cv: name: John Doe location: Location @@ -113,112 +112,6 @@ cv: - reversed_number: This is the third reversed numbered entry. design: theme: classic - page: - size: us-letter - top_margin: 2cm - bottom_margin: 2cm - left_margin: 2cm - right_margin: 2cm - show_page_numbering: true - show_last_updated_date: true - colors: - text: rgb(0, 0, 0) - name: rgb(0, 79, 144) - connections: rgb(0, 79, 144) - section_titles: rgb(0, 79, 144) - links: rgb(0, 79, 144) - last_updated_date_and_page_numbering: rgb(128, 128, 128) - text: - font_family: Source Sans 3 - font_size: 10pt - leading: 0.6em - alignment: justified - date_and_location_column_alignment: right - links: - underline: false - use_external_link_icon: true - header: - name_font_family: Source Sans 3 - name_font_size: 30pt - name_bold: true - small_caps_for_name: false - photo_width: 3.5cm - vertical_space_between_name_and_connections: 0.7cm - vertical_space_between_connections_and_first_section: 0.7cm - horizontal_space_between_connections: 0.5cm - connections_font_family: Source Sans 3 - separator_between_connections: '' - use_icons_for_connections: true - use_urls_as_placeholders_for_connections: false - make_connections_links: true - alignment: center - section_titles: - type: with-partial-line - font_family: Source Sans 3 - font_size: 1.4em - bold: true - small_caps: false - line_thickness: 0.5pt - vertical_space_above: 0.5cm - vertical_space_below: 0.3cm - entries: - date_and_location_width: 4.15cm - left_and_right_margin: 0.2cm - horizontal_space_between_columns: 0.1cm - vertical_space_between_entries: 1.2em - allow_page_break_in_sections: true - allow_page_break_in_entries: true - short_second_row: false - show_time_spans_in: [] - highlights: - bullet: • - nested_bullet: '-' - top_margin: 0.25cm - left_margin: 0.4cm - vertical_space_between_highlights: 0.25cm - horizontal_space_between_bullet_and_highlight: 0.5em - summary_left_margin: 0cm - entry_types: - one_line_entry: - template: '**LABEL:** DETAILS' - education_entry: - main_column_first_row_template: '**INSTITUTION**, AREA' - degree_column_template: '**DEGREE**' - degree_column_width: 1cm - main_column_second_row_template: |- - SUMMARY - HIGHLIGHTS - date_and_location_column_template: |- - LOCATION - DATE - normal_entry: - main_column_first_row_template: '**NAME**' - main_column_second_row_template: |- - SUMMARY - HIGHLIGHTS - date_and_location_column_template: |- - LOCATION - DATE - experience_entry: - main_column_first_row_template: '**COMPANY**, POSITION' - main_column_second_row_template: |- - SUMMARY - HIGHLIGHTS - date_and_location_column_template: |- - LOCATION - DATE - publication_entry: - main_column_first_row_template: '**TITLE**' - main_column_second_row_template: |- - AUTHORS - URL (JOURNAL) - main_column_second_row_without_journal_template: |- - AUTHORS - URL - main_column_second_row_without_url_template: |- - AUTHORS - JOURNAL - date_and_location_column_template: DATE locale: language: en phone_number_format: national @@ -259,5 +152,4 @@ locale: - December rendercv_settings: date: '2025-02-16' - render_command: bold_keywords: [] diff --git a/examples/John_Doe_EngineeringclassicTheme_CV.yaml b/examples/John_Doe_EngineeringclassicTheme_CV.yaml index 8b3072a1..bc0c4765 100644 --- a/examples/John_Doe_EngineeringclassicTheme_CV.yaml +++ b/examples/John_Doe_EngineeringclassicTheme_CV.yaml @@ -1,4 +1,3 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/rendercv/rendercv/refs/tags/v2.2/schema.json cv: name: John Doe location: Location @@ -113,106 +112,6 @@ cv: - reversed_number: This is the third reversed numbered entry. design: theme: engineeringclassic - page: - size: us-letter - top_margin: 2cm - bottom_margin: 2cm - left_margin: 2cm - right_margin: 2cm - show_page_numbering: false - show_last_updated_date: true - colors: - text: rgb(0, 0, 0) - name: rgb(0, 79, 144) - connections: rgb(0, 79, 144) - section_titles: rgb(0, 79, 144) - links: rgb(0, 79, 144) - last_updated_date_and_page_numbering: rgb(128, 128, 128) - text: - font_family: Raleway - font_size: 10pt - leading: 0.6em - alignment: justified - date_and_location_column_alignment: right - links: - underline: false - use_external_link_icon: false - header: - name_font_family: Raleway - name_font_size: 30pt - name_bold: false - small_caps_for_name: false - photo_width: 3.5cm - vertical_space_between_name_and_connections: 0.7cm - vertical_space_between_connections_and_first_section: 0.7cm - horizontal_space_between_connections: 0.5cm - connections_font_family: Raleway - separator_between_connections: '' - use_icons_for_connections: true - use_urls_as_placeholders_for_connections: false - make_connections_links: true - alignment: left - section_titles: - type: with-partial-line - font_family: Raleway - font_size: 1.4em - bold: false - small_caps: false - line_thickness: 0.5pt - vertical_space_above: 0.5cm - vertical_space_below: 0.3cm - entries: - date_and_location_width: 4.15cm - left_and_right_margin: 0.2cm - horizontal_space_between_columns: 0.1cm - vertical_space_between_entries: 1.2em - allow_page_break_in_sections: true - allow_page_break_in_entries: true - short_second_row: false - show_time_spans_in: [] - highlights: - bullet: • - nested_bullet: '-' - top_margin: 0.25cm - left_margin: 0cm - vertical_space_between_highlights: 0.25cm - horizontal_space_between_bullet_and_highlight: 0.5em - summary_left_margin: 0cm - entry_types: - one_line_entry: - template: '**LABEL:** DETAILS' - education_entry: - main_column_first_row_template: '**INSTITUTION**, AREA -- LOCATION' - degree_column_template: '**DEGREE**' - degree_column_width: 1cm - main_column_second_row_template: |- - SUMMARY - HIGHLIGHTS - date_and_location_column_template: DATE - normal_entry: - main_column_first_row_template: '**NAME** -- **LOCATION**' - main_column_second_row_template: |- - SUMMARY - HIGHLIGHTS - date_and_location_column_template: DATE - experience_entry: - main_column_first_row_template: '**POSITION**, COMPANY -- LOCATION' - main_column_second_row_template: |- - SUMMARY - HIGHLIGHTS - date_and_location_column_template: DATE - publication_entry: - main_column_first_row_template: '**TITLE**' - main_column_second_row_template: |- - AUTHORS - URL (JOURNAL) - main_column_second_row_without_journal_template: |- - AUTHORS - URL - main_column_second_row_without_url_template: |- - AUTHORS - JOURNAL - date_and_location_column_template: DATE locale: language: en phone_number_format: national @@ -253,5 +152,4 @@ locale: - December rendercv_settings: date: '2025-02-16' - render_command: bold_keywords: [] diff --git a/examples/John_Doe_EngineeringresumesTheme_CV.yaml b/examples/John_Doe_EngineeringresumesTheme_CV.yaml index 43eb6b51..8a6a4af5 100644 --- a/examples/John_Doe_EngineeringresumesTheme_CV.yaml +++ b/examples/John_Doe_EngineeringresumesTheme_CV.yaml @@ -1,4 +1,3 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/rendercv/rendercv/refs/tags/v2.2/schema.json cv: name: John Doe location: Location @@ -113,107 +112,6 @@ cv: - reversed_number: This is the third reversed numbered entry. design: theme: engineeringresumes - page: - size: us-letter - top_margin: 2cm - bottom_margin: 2cm - left_margin: 2cm - right_margin: 2cm - show_page_numbering: false - show_last_updated_date: true - colors: - text: rgb(0, 0, 0) - name: rgb(0, 0, 0) - connections: rgb(0, 0, 0) - section_titles: rgb(0, 0, 0) - links: rgb(0, 0, 0) - last_updated_date_and_page_numbering: rgb(128, 128, 128) - text: - font_family: XCharter - font_size: 10pt - leading: 0.6em - alignment: justified - date_and_location_column_alignment: right - links: - underline: true - use_external_link_icon: false - header: - name_font_family: XCharter - name_font_size: 25pt - name_bold: false - small_caps_for_name: false - photo_width: 3.5cm - vertical_space_between_name_and_connections: 0.7cm - vertical_space_between_connections_and_first_section: 0.7cm - horizontal_space_between_connections: 0.5cm - connections_font_family: XCharter - separator_between_connections: '|' - use_icons_for_connections: false - use_urls_as_placeholders_for_connections: true - make_connections_links: true - alignment: center - section_titles: - type: with-partial-line - font_family: XCharter - font_size: 1.2em - bold: true - small_caps: false - line_thickness: 0.5pt - vertical_space_above: 0.55cm - vertical_space_below: 0.3cm - line_type: with-full-line - entries: - date_and_location_width: 4.15cm - left_and_right_margin: 0cm - horizontal_space_between_columns: 0.1cm - vertical_space_between_entries: 0.4cm - allow_page_break_in_sections: true - allow_page_break_in_entries: true - short_second_row: false - show_time_spans_in: [] - highlights: - bullet: • - nested_bullet: '-' - top_margin: 0.25cm - left_margin: 0cm - vertical_space_between_highlights: 0.19cm - horizontal_space_between_bullet_and_highlight: 0.3em - summary_left_margin: 0cm - entry_types: - one_line_entry: - template: '**LABEL:** DETAILS' - education_entry: - main_column_first_row_template: '**INSTITUTION**, DEGREE in AREA -- LOCATION' - degree_column_template: - degree_column_width: 1cm - main_column_second_row_template: |- - SUMMARY - HIGHLIGHTS - date_and_location_column_template: DATE - normal_entry: - main_column_first_row_template: '**NAME** -- **LOCATION**' - main_column_second_row_template: |- - SUMMARY - HIGHLIGHTS - date_and_location_column_template: DATE - experience_entry: - main_column_first_row_template: '**POSITION**, COMPANY -- LOCATION' - main_column_second_row_template: |- - SUMMARY - HIGHLIGHTS - date_and_location_column_template: DATE - publication_entry: - main_column_first_row_template: '**TITLE**' - main_column_second_row_template: |- - AUTHORS - URL (JOURNAL) - main_column_second_row_without_journal_template: |- - AUTHORS - URL - main_column_second_row_without_url_template: |- - AUTHORS - JOURNAL - date_and_location_column_template: DATE locale: language: en phone_number_format: national @@ -254,5 +152,4 @@ locale: - December rendercv_settings: date: '2025-02-16' - render_command: bold_keywords: [] diff --git a/examples/John_Doe_ModerncvTheme_CV.yaml b/examples/John_Doe_ModerncvTheme_CV.yaml index b9934e54..c4289ae3 100644 --- a/examples/John_Doe_ModerncvTheme_CV.yaml +++ b/examples/John_Doe_ModerncvTheme_CV.yaml @@ -1,4 +1,3 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/rendercv/rendercv/refs/tags/v2.2/schema.json cv: name: John Doe location: Location @@ -113,106 +112,6 @@ cv: - reversed_number: This is the third reversed numbered entry. design: theme: moderncv - page: - size: us-letter - top_margin: 2cm - bottom_margin: 2cm - left_margin: 2cm - right_margin: 2cm - show_page_numbering: true - show_last_updated_date: true - colors: - text: rgb(0, 0, 0) - name: rgb(0, 79, 144) - connections: rgb(0, 79, 144) - section_titles: rgb(0, 79, 144) - links: rgb(0, 79, 144) - last_updated_date_and_page_numbering: rgb(128, 128, 128) - text: - font_family: Fontin - font_size: 10pt - leading: 0.6em - alignment: justified - date_and_location_column_alignment: right - links: - underline: true - use_external_link_icon: false - header: - name_font_family: Fontin - name_font_size: 25pt - name_bold: false - small_caps_for_name: false - photo_width: 3.5cm - vertical_space_between_name_and_connections: 0.7cm - vertical_space_between_connections_and_first_section: 0.7cm - horizontal_space_between_connections: 0.5cm - connections_font_family: Fontin - separator_between_connections: '' - use_icons_for_connections: true - use_urls_as_placeholders_for_connections: false - make_connections_links: true - alignment: left - section_titles: - type: moderncv - font_family: Fontin - font_size: 1.4em - bold: false - small_caps: false - line_thickness: 0.15cm - vertical_space_above: 0.55cm - vertical_space_below: 0.3cm - entries: - date_and_location_width: 4.15cm - left_and_right_margin: 0cm - horizontal_space_between_columns: 0.4cm - vertical_space_between_entries: 0.4cm - allow_page_break_in_sections: true - allow_page_break_in_entries: true - short_second_row: false - show_time_spans_in: [] - highlights: - bullet: • - nested_bullet: '-' - top_margin: 0.25cm - left_margin: 0cm - vertical_space_between_highlights: 0.19cm - horizontal_space_between_bullet_and_highlight: 0.3em - summary_left_margin: 0cm - entry_types: - one_line_entry: - template: '**LABEL:** DETAILS' - education_entry: - main_column_first_row_template: '**INSTITUTION**, DEGREE in AREA -- LOCATION' - degree_column_template: - degree_column_width: 1cm - main_column_second_row_template: |- - SUMMARY - HIGHLIGHTS - date_and_location_column_template: DATE - normal_entry: - main_column_first_row_template: '**NAME** -- **LOCATION**' - main_column_second_row_template: |- - SUMMARY - HIGHLIGHTS - date_and_location_column_template: DATE - experience_entry: - main_column_first_row_template: '**POSITION**, COMPANY -- LOCATION' - main_column_second_row_template: |- - SUMMARY - HIGHLIGHTS - date_and_location_column_template: DATE - publication_entry: - main_column_first_row_template: '**TITLE**' - main_column_second_row_template: |- - AUTHORS - URL (JOURNAL) - main_column_second_row_without_journal_template: |- - AUTHORS - URL - main_column_second_row_without_url_template: |- - AUTHORS - JOURNAL - date_and_location_column_template: DATE locale: language: en phone_number_format: national @@ -253,5 +152,4 @@ locale: - December rendercv_settings: date: '2025-02-16' - render_command: bold_keywords: [] diff --git a/examples/John_Doe_Sb2novTheme_CV.yaml b/examples/John_Doe_Sb2novTheme_CV.yaml index eb480721..d3ef2e1b 100644 --- a/examples/John_Doe_Sb2novTheme_CV.yaml +++ b/examples/John_Doe_Sb2novTheme_CV.yaml @@ -1,4 +1,3 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/rendercv/rendercv/refs/tags/v2.2/schema.json cv: name: John Doe location: Location @@ -113,117 +112,6 @@ cv: - reversed_number: This is the third reversed numbered entry. design: theme: sb2nov - page: - size: us-letter - top_margin: 2cm - bottom_margin: 2cm - left_margin: 2cm - right_margin: 2cm - show_page_numbering: true - show_last_updated_date: true - colors: - text: rgb(0, 0, 0) - name: rgb(0, 0, 0) - connections: rgb(0, 0, 0) - section_titles: rgb(0, 0, 0) - links: rgb(0, 79, 144) - last_updated_date_and_page_numbering: rgb(128, 128, 128) - text: - font_family: New Computer Modern - font_size: 10pt - leading: 0.6em - alignment: justified - date_and_location_column_alignment: right - links: - underline: true - use_external_link_icon: false - header: - name_font_family: New Computer Modern - name_font_size: 30pt - name_bold: true - small_caps_for_name: false - photo_width: 3.5cm - vertical_space_between_name_and_connections: 0.7cm - vertical_space_between_connections_and_first_section: 0.7cm - horizontal_space_between_connections: 0.5cm - connections_font_family: New Computer Modern - separator_between_connections: '' - use_icons_for_connections: true - use_urls_as_placeholders_for_connections: false - make_connections_links: true - alignment: center - section_titles: - type: with-partial-line - font_family: New Computer Modern - font_size: 1.4em - bold: true - small_caps: false - line_thickness: 0.5pt - vertical_space_above: 0.5cm - vertical_space_below: 0.3cm - line_type: with-full-line - entries: - date_and_location_width: 4.15cm - left_and_right_margin: 0.2cm - horizontal_space_between_columns: 0.1cm - vertical_space_between_entries: 1.2em - allow_page_break_in_sections: true - allow_page_break_in_entries: true - short_second_row: false - show_time_spans_in: [] - highlights: - bullet: ◦ - nested_bullet: '-' - top_margin: 0.25cm - left_margin: 0.4cm - vertical_space_between_highlights: 0.25cm - horizontal_space_between_bullet_and_highlight: 0.5em - summary_left_margin: 0cm - entry_types: - one_line_entry: - template: '**LABEL:** DETAILS' - education_entry: - main_column_first_row_template: |- - **INSTITUTION** - *DEGREE in AREA* - degree_column_template: - degree_column_width: 1cm - main_column_second_row_template: |- - SUMMARY - HIGHLIGHTS - date_and_location_column_template: |- - *LOCATION* - *DATE* - normal_entry: - main_column_first_row_template: '**NAME**' - main_column_second_row_template: |- - SUMMARY - HIGHLIGHTS - date_and_location_column_template: |- - *LOCATION* - *DATE* - experience_entry: - main_column_first_row_template: |- - **POSITION** - *COMPANY* - main_column_second_row_template: |- - SUMMARY - HIGHLIGHTS - date_and_location_column_template: |- - *LOCATION* - *DATE* - publication_entry: - main_column_first_row_template: '**TITLE**' - main_column_second_row_template: |- - AUTHORS - URL (JOURNAL) - main_column_second_row_without_journal_template: |- - AUTHORS - URL - main_column_second_row_without_url_template: |- - AUTHORS - JOURNAL - date_and_location_column_template: DATE locale: language: en phone_number_format: national @@ -264,5 +152,4 @@ locale: - December rendercv_settings: date: '2025-02-16' - render_command: bold_keywords: [] diff --git a/rendercv/api/functions.py b/rendercv/api/functions.py index 76530cd4..03bd76b7 100644 --- a/rendercv/api/functions.py +++ b/rendercv/api/functions.py @@ -65,8 +65,8 @@ def _create_a_file_from_something( with tempfile.TemporaryDirectory() as temp_dir: temporary_output_path = pathlib.Path(temp_dir) - typst_file = renderer(data_model, temporary_output_path) - shutil.move(typst_file, output_file_path) + file = renderer(data_model, temporary_output_path) + shutil.move(file, output_file_path) return None @@ -350,7 +350,9 @@ def create_a_pdf_from_a_yaml_string( return _create_a_file_from_something( yaml_file_as_string, read_a_yaml_string_and_return_a_data_model, - renderer.create_a_typst_file, + lambda x, y: renderer.render_a_pdf_from_typst( + renderer.create_a_typst_file(x, y) + ), output_file_path, ) @@ -373,6 +375,8 @@ def create_a_pdf_from_a_python_dictionary( return _create_a_file_from_something( input_file_as_a_dict, read_a_python_dictionary_and_return_a_data_model, - renderer.create_a_typst_file, + lambda x, y: renderer.render_a_pdf_from_typst( + renderer.create_a_typst_file(x, y), + ), output_file_path, ) diff --git a/rendercv/data/generator.py b/rendercv/data/generator.py index e14552e5..a2c88e3d 100644 --- a/rendercv/data/generator.py +++ b/rendercv/data/generator.py @@ -107,9 +107,15 @@ def create_a_sample_yaml_input_file( # process easier. "cv.sections_input" exists for the convenience of the user. # Also, we don't want to show the cv.photo field in the Web app. data_model_as_json = data_model.model_dump_json( - exclude_none=False, by_alias=True, exclude={"cv": {"sections", "photo"}} + exclude_none=False, + by_alias=True, + exclude={ + "cv": {"sections", "photo"}, + "rendercv_settings": {"render_command"}, + }, ) data_model_as_dictionary = json.loads(data_model_as_json) + data_model_as_dictionary["design"] = {"theme": theme} yaml_string = dictionary_to_yaml(data_model_as_dictionary) diff --git a/rendercv/data/models/curriculum_vitae.py b/rendercv/data/models/curriculum_vitae.py index 3b594791..08ab3cbf 100644 --- a/rendercv/data/models/curriculum_vitae.py +++ b/rendercv/data/models/curriculum_vitae.py @@ -327,6 +327,9 @@ available_social_networks = get_args(SocialNetworkName) class SocialNetwork(RenderCVBaseModelWithoutExtraKeys): """This class is the data model of a social network.""" + model_config = pydantic.ConfigDict( + title="Social Network", + ) network: SocialNetworkName = pydantic.Field( title="Social Network", ) @@ -393,6 +396,9 @@ class SocialNetwork(RenderCVBaseModelWithoutExtraKeys): class CurriculumVitae(RenderCVBaseModelWithExtraKeys): """This class is the data model of the `cv` field.""" + model_config = pydantic.ConfigDict( + title="CV", + ) name: Optional[str] = pydantic.Field( default=None, title="Name", diff --git a/rendercv/data/models/entry_types.py b/rendercv/data/models/entry_types.py index 73b27b39..ca5e1e30 100644 --- a/rendercv/data/models/entry_types.py +++ b/rendercv/data/models/entry_types.py @@ -207,6 +207,7 @@ def make_keywords_bold_in_a_string(string: str, keywords: list[str]) -> str: class OneLineEntry(RenderCVBaseModelWithExtraKeys, EntryType): """This class is the data model of `OneLineEntry`.""" + model_config = pydantic.ConfigDict(title="One Line Entry") label: str = pydantic.Field( title="Label", ) @@ -230,6 +231,7 @@ class OneLineEntry(RenderCVBaseModelWithExtraKeys, EntryType): class BulletEntry(RenderCVBaseModelWithExtraKeys, EntryType): """This class is the data model of `BulletEntry`.""" + model_config = pydantic.ConfigDict(title="Bullet Entry") bullet: str = pydantic.Field( title="Bullet", ) @@ -250,6 +252,8 @@ class BulletEntry(RenderCVBaseModelWithExtraKeys, EntryType): class NumberedEntry(RenderCVBaseModelWithExtraKeys, EntryType): """This class is the data model of `NumberedEntry`.""" + model_config = pydantic.ConfigDict(title="Numbered Entry") + number: str = pydantic.Field( title="Number", ) @@ -270,6 +274,7 @@ class NumberedEntry(RenderCVBaseModelWithExtraKeys, EntryType): class ReversedNumberedEntry(RenderCVBaseModelWithExtraKeys, EntryType): """This class is the data model of `ReversedNumberedEntry`.""" + model_config = pydantic.ConfigDict(title="Reversed Numbered Entry") reversed_number: str = pydantic.Field( title="Reversed Number", ) @@ -386,6 +391,8 @@ class PublicationEntry(EntryWithDate, PublicationEntryBase, EntryType): the fields in the correct order. """ + model_config = pydantic.ConfigDict(title="Publication Entry") + class EntryBase(EntryWithDate): """This class is the parent class of some of the entry types. It is being used @@ -534,6 +541,8 @@ class NormalEntry(EntryBase, NormalEntryBase, EntryType): correct order. """ + model_config = pydantic.ConfigDict(title="Normal Entry") + class ExperienceEntryBase(RenderCVBaseModelWithExtraKeys): """This class is the parent class of the `ExperienceEntry` class.""" @@ -552,6 +561,8 @@ class ExperienceEntry(EntryBase, ExperienceEntryBase, EntryType): fields in the correct order. """ + model_config = pydantic.ConfigDict(title="Experience Entry") + class EducationEntryBase(RenderCVBaseModelWithExtraKeys): """This class is the parent class of the `EducationEntry` class.""" @@ -576,6 +587,8 @@ class EducationEntry(EntryBase, EducationEntryBase, EntryType): fields in the correct order. """ + model_config = pydantic.ConfigDict(title="Education Entry") + # ====================================================================================== # Create custom types based on the entry models: ======================================= diff --git a/rendercv/data/models/locale.py b/rendercv/data/models/locale.py index 2aacfa0b..64337257 100644 --- a/rendercv/data/models/locale.py +++ b/rendercv/data/models/locale.py @@ -17,6 +17,8 @@ class Locale(RenderCVBaseModelWithoutExtraKeys): updates the `locale` dictionary. """ + model_config = pydantic.ConfigDict(title="Locale") + language: pydantic_extra_types.language_code.LanguageAlpha2 = pydantic.Field( default="en", # type: ignore title="Language", diff --git a/rendercv/data/models/rendercv_settings.py b/rendercv/data/models/rendercv_settings.py index 3306c9dd..12910582 100644 --- a/rendercv/data/models/rendercv_settings.py +++ b/rendercv/data/models/rendercv_settings.py @@ -191,6 +191,8 @@ class RenderCommandSettings(RenderCVBaseModelWithoutExtraKeys): class RenderCVSettings(RenderCVBaseModelWithoutExtraKeys): """This class is the data model of the RenderCV settings.""" + model_config = pydantic.ConfigDict(title="RenderCV Settings") + date: datetime.date = pydantic.Field( default=datetime.date.today(), title="Date", diff --git a/rendercv/themes/options.py b/rendercv/themes/options.py index e768fbea..c2f0737a 100644 --- a/rendercv/themes/options.py +++ b/rendercv/themes/options.py @@ -97,7 +97,10 @@ def validate_font_family(font_family: str) -> str: FontFamily = Annotated[ str, - pydantic.PlainValidator(validate_font_family), + pydantic.PlainValidator( + validate_font_family, + json_schema_input_type=Literal[tuple(available_font_families)], + ), ] BulletPoint = Literal["•", "◦", "-", "◆", "★", "■", "—", "○"] PageSize = Literal[ @@ -121,10 +124,11 @@ PageSize = Literal[ ] Alignment = Literal["left", "center", "right"] TextAlignment = Literal["left", "justified", "justified-with-no-hyphenation"] -SectionTitleType = Optional[ - Literal["with-partial-line", "with-full-line", "without-line", "moderncv"] +SectionTitleType = Literal[ + "with-partial-line", "with-full-line", "without-line", "moderncv" ] + page_size_field_info = pydantic.Field( default="us-letter", title="Page Size", @@ -169,6 +173,8 @@ page_show_last_updated_date_field_info = pydantic.Field( class Page(RenderCVBaseModelWithoutExtraKeys): """Options related to the page.""" + model_config = pydantic.ConfigDict(title="Page") + size: PageSize = page_size_field_info top_margin: TypstDimension = page_top_margin_field_info bottom_margin: TypstDimension = page_bottom_margin_field_info @@ -232,6 +238,8 @@ colors_last_updated_date_and_page_numbering_field_info = pydantic.Field( class Colors(RenderCVBaseModelWithoutExtraKeys): """Color used throughout the CV.""" + model_config = pydantic.ConfigDict(title="Colors") + text: pydantic_color.Color = colors_text_field_info name: pydantic_color.Color = colors_name_field_info connections: pydantic_color.Color = colors_connections_field_info @@ -283,6 +291,8 @@ text_date_and_location_column_alignment_field_info = pydantic.Field( class Text(RenderCVBaseModelWithoutExtraKeys): """Options related to text.""" + model_config = pydantic.ConfigDict(title="Text") + font_family: FontFamily = text_font_family_field_info font_size: TypstDimension = text_font_size_field_info leading: TypstDimension = text_leading_field_info @@ -310,6 +320,7 @@ links_use_external_link_icon_field_info = pydantic.Field( class Links(RenderCVBaseModelWithoutExtraKeys): """Options related to links.""" + model_config = pydantic.ConfigDict(title="Links") underline: bool = links_underline_field_info use_external_link_icon: bool = links_use_external_link_icon_field_info @@ -401,6 +412,7 @@ header_alignment_field_info = pydantic.Field( class Header(RenderCVBaseModelWithoutExtraKeys): """Options related to headers.""" + model_config = pydantic.ConfigDict(title="Header") name_font_family: FontFamily = header_name_font_family_field_info name_font_size: TypstDimension = header_name_font_size_field_info name_bold: bool = header_name_bold_field_info @@ -450,7 +462,7 @@ section_titles_bold_field_info = pydantic.Field( ) section_titles_type_field_info = pydantic.Field( default="with-partial-line", - title="Line Type", + title="Type", description="The type of the section titles.", ) section_titles_line_thickness_field_info = pydantic.Field( @@ -478,6 +490,8 @@ section_titles_small_caps_field_info = pydantic.Field( class SectionTitles(RenderCVBaseModelWithoutExtraKeys): """Options related to section titles.""" + model_config = pydantic.ConfigDict(title="Section Titles") + type: SectionTitleType = section_titles_type_field_info font_family: FontFamily = section_titles_font_family_field_info font_size: TypstDimension = section_titles_font_size_field_info @@ -546,6 +560,8 @@ entries_show_time_spans_in_field_info = pydantic.Field( class Entries(RenderCVBaseModelWithoutExtraKeys): """Options related to entries.""" + model_config = pydantic.ConfigDict(title="Entries") + date_and_location_width: TypstDimension = entries_date_and_location_width_field_info left_and_right_margin: TypstDimension = entries_left_and_right_margin_field_info horizontal_space_between_columns: TypstDimension = ( @@ -600,6 +616,8 @@ highlights_summary_left_margin_field_info = pydantic.Field( class Highlights(RenderCVBaseModelWithoutExtraKeys): """Options related to highlights.""" + model_config = pydantic.ConfigDict(title="Highlights") + bullet: BulletPoint = highlights_bullet_field_info nested_bullet: BulletPoint = highlights_nested_bullet_field_info top_margin: TypstDimension = highlights_top_margin_field_info @@ -687,6 +705,8 @@ publication_entry_date_and_location_column_template_field_info = pydantic.Field( class PublicationEntryOptions(RenderCVBaseModelWithoutExtraKeys): """Options related to publication entries.""" + model_config = pydantic.ConfigDict(title="Publication Entry Options") + main_column_first_row_template: str = ( publication_entry_main_column_first_row_template_field_info ) @@ -745,6 +765,8 @@ class EducationEntryBase(RenderCVBaseModelWithoutExtraKeys): class EducationEntryOptions(EntryBaseWithDate, EducationEntryBase): """Options related to education entries.""" + model_config = pydantic.ConfigDict(title="Education Entry Options") + normal_entry_main_column_first_row_template_field_info = pydantic.Field( default="**NAME**", @@ -767,6 +789,8 @@ class NormalEntryBase(RenderCVBaseModelWithoutExtraKeys): class NormalEntryOptions(EntryBaseWithDate, NormalEntryBase): """Options related to normal entries.""" + model_config = pydantic.ConfigDict(title="Normal Entry Options") + experience_entry_main_column_first_row_template_field_info = pydantic.Field( default="**COMPANY**, POSITION", @@ -789,6 +813,8 @@ class ExperienceEntryBase(RenderCVBaseModelWithoutExtraKeys): class ExperienceEntryOptions(EntryBaseWithDate, ExperienceEntryBase): """Options related to experience entries.""" + model_config = pydantic.ConfigDict(title="Experience Entry Options") + one_line_entry_template_field_info = pydantic.Field( default="**LABEL:** DETAILS", @@ -803,6 +829,7 @@ one_line_entry_template_field_info = pydantic.Field( class OneLineEntryOptions(RenderCVBaseModelWithoutExtraKeys): """Options related to one-line entries.""" + model_config = pydantic.ConfigDict(title="One Line Entry Options") template: str = one_line_entry_template_field_info @@ -836,6 +863,7 @@ entry_types_publication_entry_field_info = pydantic.Field( class EntryTypes(RenderCVBaseModelWithoutExtraKeys): """Options related to the templates.""" + model_config = pydantic.ConfigDict(title="Entry Types") one_line_entry: OneLineEntryOptions = entry_types_one_line_entry_field_info education_entry: EducationEntryOptions = entry_types_education_entry_field_info normal_entry: NormalEntryOptions = entry_types_normal_entry_field_info @@ -900,6 +928,7 @@ theme_options_entry_types_field_info = pydantic.Field( class ThemeOptions(RenderCVBaseModelWithoutExtraKeys): """Full design options.""" + model_config = pydantic.ConfigDict(title="Theme Options") theme: Literal["tobeoverwritten"] = theme_options_theme_field_info page: Page = theme_options_page_field_info colors: Colors = theme_options_colors_field_info diff --git a/schema.json b/schema.json index a8520578..88a7ac81 100644 --- a/schema.json +++ b/schema.json @@ -11,7 +11,7 @@ "required": [ "bullet" ], - "title": "BulletEntry", + "title": "Bullet Entry", "type": "object" }, "ClassicThemeOptions": { @@ -95,8 +95,7 @@ "line_thickness": "0.5pt", "vertical_space_above": "0.5cm", "vertical_space_below": "0.3cm" - }, - "title": "Section Titles" + } }, "entries": { "$ref": "#/$defs/rendercv__themes__options__Entries", @@ -157,7 +156,7 @@ "title": "Templates" } }, - "title": "ClassicThemeOptions", + "title": "Theme Options", "type": "object" }, "CurriculumVitae": { @@ -330,7 +329,7 @@ ] } }, - "title": "CurriculumVitae", + "title": "CV", "type": "object" }, "EducationEntry": { @@ -482,7 +481,7 @@ "institution", "area" ], - "title": "EducationEntry", + "title": "Education Entry", "type": "object" }, "EngineeringclassicThemeOptions": { @@ -571,8 +570,7 @@ "vertical_space_above": "0.5cm", "vertical_space_below": "0.3cm" }, - "description": "Options related to section titles.", - "title": "Section Titles" + "description": "Options related to section titles." }, "entries": { "$ref": "#/$defs/rendercv__themes__options__Entries", @@ -635,7 +633,7 @@ "title": "Templates" } }, - "title": "EngineeringclassicThemeOptions", + "title": "Theme Options", "type": "object" }, "EngineeringresumesThemeOptions": { @@ -726,8 +724,7 @@ "vertical_space_below": "0.3cm", "line_type": "with-full-line" }, - "description": "Options related to section titles.", - "title": "Section Titles" + "description": "Options related to section titles." }, "entries": { "$ref": "#/$defs/rendercv__themes__engineeringresumes__Entries", @@ -791,7 +788,7 @@ "title": "Templates" } }, - "title": "EngineeringresumesThemeOptions", + "title": "Theme Options", "type": "object" }, "EntryTypes": { @@ -846,7 +843,7 @@ "title": "Publication Entry" } }, - "title": "EntryTypes", + "title": "Entry Types", "type": "object" }, "ExperienceEntry": { @@ -979,7 +976,7 @@ "company", "position" ], - "title": "ExperienceEntry", + "title": "Experience Entry", "type": "object" }, "Locale": { @@ -1264,8 +1261,7 @@ "vertical_space_above": "0.55cm", "vertical_space_below": "0.3cm" }, - "description": "Options related to section titles.", - "title": "Section Titles" + "description": "Options related to section titles." }, "entries": { "$ref": "#/$defs/rendercv__themes__moderncv__Entries", @@ -1329,7 +1325,7 @@ "title": "Templates" } }, - "title": "ModerncvThemeOptions", + "title": "Theme Options", "type": "object" }, "NormalEntry": { @@ -1457,7 +1453,7 @@ "required": [ "name" ], - "title": "NormalEntry", + "title": "Normal Entry", "type": "object" }, "NumberedEntry": { @@ -1471,7 +1467,7 @@ "required": [ "number" ], - "title": "NumberedEntry", + "title": "Numbered Entry", "type": "object" }, "OneLineEntry": { @@ -1490,7 +1486,7 @@ "label", "details" ], - "title": "OneLineEntry", + "title": "One Line Entry", "type": "object" }, "OneLineEntryOptions": { @@ -1504,7 +1500,7 @@ "type": "string" } }, - "title": "OneLineEntryOptions", + "title": "One Line Entry Options", "type": "object" }, "PublicationEntry": { @@ -1590,7 +1586,7 @@ "title", "authors" ], - "title": "PublicationEntry", + "title": "Publication Entry", "type": "object" }, "PublicationEntryOptions": { @@ -1628,7 +1624,7 @@ "type": "string" } }, - "title": "PublicationEntryOptions", + "title": "Publication Entry Options", "type": "object" }, "RenderCVSettings": { @@ -1664,7 +1660,7 @@ "type": "array" } }, - "title": "RenderCVSettings", + "title": "RenderCV Settings", "type": "object" }, "RenderCommandSettings": { @@ -1827,7 +1823,7 @@ "required": [ "reversed_number" ], - "title": "ReversedNumberedEntry", + "title": "Reversed Numbered Entry", "type": "object" }, "Sb2novThemeOptions": { @@ -1917,8 +1913,7 @@ "vertical_space_below": "0.3cm", "line_type": "with-full-line" }, - "description": "Options related to section titles.", - "title": "Section Titles" + "description": "Options related to section titles." }, "entries": { "$ref": "#/$defs/rendercv__themes__options__Entries", @@ -1981,7 +1976,7 @@ "title": "Templates" } }, - "title": "Sb2novThemeOptions", + "title": "Theme Options", "type": "object" }, "SocialNetwork": { @@ -2015,7 +2010,7 @@ "network", "username" ], - "title": "SocialNetwork", + "title": "Social Network", "type": "object" }, "rendercv__themes__engineeringclassic__EducationEntryOptions": { @@ -2059,7 +2054,7 @@ "type": "string" } }, - "title": "EducationEntryOptions", + "title": "Education Entry Options", "type": "object" }, "rendercv__themes__engineeringclassic__EntryOptionsTypes": { @@ -2116,7 +2111,7 @@ "title": "Publication Entry" } }, - "title": "EntryOptionsTypes", + "title": "Entry Types", "type": "object" }, "rendercv__themes__engineeringclassic__ExperienceEntryOptions": { @@ -2141,7 +2136,7 @@ "type": "string" } }, - "title": "ExperienceEntryOptions", + "title": "Experience Entry Options", "type": "object" }, "rendercv__themes__engineeringclassic__Header": { @@ -2150,7 +2145,27 @@ "name_font_family": { "default": "Raleway", "description": "The font family of the name in the header.", - "title": "Name Font Family" + "enum": [ + "Libertinus Serif", + "New Computer Modern", + "DejaVu Sans Mono", + "Mukta", + "Open Sans", + "Gentium Book Plus", + "Noto Sans", + "Lato", + "Source Sans 3", + "EB Garamond", + "Open Sauce Sans", + "Fontin", + "Roboto", + "Ubuntu", + "Poppins", + "Raleway", + "XCharter" + ], + "title": "Name Font Family", + "type": "string" }, "name_font_size": { "default": "30pt", @@ -2197,7 +2212,27 @@ "connections_font_family": { "default": "Raleway", "description": "The font family of the connections in the header.", - "title": "Connections Font Family" + "enum": [ + "Libertinus Serif", + "New Computer Modern", + "DejaVu Sans Mono", + "Mukta", + "Open Sans", + "Gentium Book Plus", + "Noto Sans", + "Lato", + "Source Sans 3", + "EB Garamond", + "Open Sauce Sans", + "Fontin", + "Roboto", + "Ubuntu", + "Poppins", + "Raleway", + "XCharter" + ], + "title": "Connections Font Family", + "type": "string" }, "separator_between_connections": { "default": null, @@ -2355,7 +2390,7 @@ "type": "string" } }, - "title": "NormalEntryOptions", + "title": "Normal Entry Options", "type": "object" }, "rendercv__themes__engineeringclassic__Page": { @@ -2432,26 +2467,39 @@ "type": { "default": "with-partial-line", "description": "The type of the section titles.", - "title": "Line Type", - "oneOf": [ - { - "enum": [ - "with-partial-line", - "with-full-line", - "without-line", - "moderncv" - ], - "type": "string" - }, - { - "type": "null" - } - ] + "enum": [ + "with-partial-line", + "with-full-line", + "without-line", + "moderncv" + ], + "title": "Type", + "type": "string" }, "font_family": { "default": "Raleway", "description": "The font family of the section titles.", - "title": "Font Family" + "enum": [ + "Libertinus Serif", + "New Computer Modern", + "DejaVu Sans Mono", + "Mukta", + "Open Sans", + "Gentium Book Plus", + "Noto Sans", + "Lato", + "Source Sans 3", + "EB Garamond", + "Open Sauce Sans", + "Fontin", + "Roboto", + "Ubuntu", + "Poppins", + "Raleway", + "XCharter" + ], + "title": "Font Family", + "type": "string" }, "font_size": { "default": "1.4em", @@ -2490,7 +2538,7 @@ "type": "string" } }, - "title": "SectionTitles", + "title": "Section Titles", "type": "object" }, "rendercv__themes__engineeringclassic__Text": { @@ -2499,7 +2547,27 @@ "font_family": { "default": "Raleway", "description": "The font family.", - "title": "Font Family" + "enum": [ + "Libertinus Serif", + "New Computer Modern", + "DejaVu Sans Mono", + "Mukta", + "Open Sans", + "Gentium Book Plus", + "Noto Sans", + "Lato", + "Source Sans 3", + "EB Garamond", + "Open Sauce Sans", + "Fontin", + "Roboto", + "Ubuntu", + "Poppins", + "Raleway", + "XCharter" + ], + "title": "Font Family", + "type": "string" }, "font_size": { "default": "10pt", @@ -2665,7 +2733,7 @@ "type": "string" } }, - "title": "EducationEntryOptions", + "title": "Education Entry Options", "type": "object" }, "rendercv__themes__engineeringresumes__Entries": { @@ -2780,7 +2848,7 @@ "title": "Publication Entry" } }, - "title": "EntryOptionsTypes", + "title": "Entry Types", "type": "object" }, "rendercv__themes__engineeringresumes__ExperienceEntryOptions": { @@ -2805,7 +2873,7 @@ "type": "string" } }, - "title": "ExperienceEntryOptions", + "title": "Experience Entry Options", "type": "object" }, "rendercv__themes__engineeringresumes__Header": { @@ -2814,7 +2882,27 @@ "name_font_family": { "default": "XCharter", "description": "The font family of the name in the header.", - "title": "Name Font Family" + "enum": [ + "Libertinus Serif", + "New Computer Modern", + "DejaVu Sans Mono", + "Mukta", + "Open Sans", + "Gentium Book Plus", + "Noto Sans", + "Lato", + "Source Sans 3", + "EB Garamond", + "Open Sauce Sans", + "Fontin", + "Roboto", + "Ubuntu", + "Poppins", + "Raleway", + "XCharter" + ], + "title": "Name Font Family", + "type": "string" }, "name_font_size": { "default": "25pt", @@ -2860,7 +2948,27 @@ "connections_font_family": { "default": "XCharter", "description": "The font family of the connections in the header.", - "title": "Connections Font Family" + "enum": [ + "Libertinus Serif", + "New Computer Modern", + "DejaVu Sans Mono", + "Mukta", + "Open Sans", + "Gentium Book Plus", + "Noto Sans", + "Lato", + "Source Sans 3", + "EB Garamond", + "Open Sauce Sans", + "Fontin", + "Roboto", + "Ubuntu", + "Poppins", + "Raleway", + "XCharter" + ], + "title": "Connections Font Family", + "type": "string" }, "separator_between_connections": { "default": "|", @@ -3011,7 +3119,7 @@ "type": "string" } }, - "title": "NormalEntryOptions", + "title": "Normal Entry Options", "type": "object" }, "rendercv__themes__engineeringresumes__Page": { @@ -3088,26 +3196,39 @@ "type": { "default": "with-partial-line", "description": "The type of the section titles.", - "title": "Line Type", - "oneOf": [ - { - "enum": [ - "with-partial-line", - "with-full-line", - "without-line", - "moderncv" - ], - "type": "string" - }, - { - "type": "null" - } - ] + "enum": [ + "with-partial-line", + "with-full-line", + "without-line", + "moderncv" + ], + "title": "Type", + "type": "string" }, "font_family": { "default": "XCharter", "description": "The font family of the section titles.", - "title": "Font Family" + "enum": [ + "Libertinus Serif", + "New Computer Modern", + "DejaVu Sans Mono", + "Mukta", + "Open Sans", + "Gentium Book Plus", + "Noto Sans", + "Lato", + "Source Sans 3", + "EB Garamond", + "Open Sauce Sans", + "Fontin", + "Roboto", + "Ubuntu", + "Poppins", + "Raleway", + "XCharter" + ], + "title": "Font Family", + "type": "string" }, "font_size": { "default": "1.2em", @@ -3148,24 +3269,17 @@ "line_type": { "default": "with-full-line", "description": "The type of the section titles.", - "title": "Line Type", - "oneOf": [ - { - "enum": [ - "with-partial-line", - "with-full-line", - "without-line", - "moderncv" - ], - "type": "string" - }, - { - "type": "null" - } - ] + "enum": [ + "with-partial-line", + "with-full-line", + "without-line", + "moderncv" + ], + "title": "Type", + "type": "string" } }, - "title": "SectionTitles", + "title": "Section Titles", "type": "object" }, "rendercv__themes__engineeringresumes__Text": { @@ -3174,7 +3288,27 @@ "font_family": { "default": "XCharter", "description": "The font family.", - "title": "Font Family" + "enum": [ + "Libertinus Serif", + "New Computer Modern", + "DejaVu Sans Mono", + "Mukta", + "Open Sans", + "Gentium Book Plus", + "Noto Sans", + "Lato", + "Source Sans 3", + "EB Garamond", + "Open Sauce Sans", + "Fontin", + "Roboto", + "Ubuntu", + "Poppins", + "Raleway", + "XCharter" + ], + "title": "Font Family", + "type": "string" }, "font_size": { "default": "10pt", @@ -3255,7 +3389,7 @@ "type": "string" } }, - "title": "EducationEntryOptions", + "title": "Education Entry Options", "type": "object" }, "rendercv__themes__moderncv__Entries": { @@ -3370,7 +3504,7 @@ "title": "Publication Entry" } }, - "title": "EntryOptionsTypes", + "title": "Entry Types", "type": "object" }, "rendercv__themes__moderncv__ExperienceEntryOptions": { @@ -3395,7 +3529,7 @@ "type": "string" } }, - "title": "ExperienceEntryOptions", + "title": "Experience Entry Options", "type": "object" }, "rendercv__themes__moderncv__Header": { @@ -3404,7 +3538,27 @@ "name_font_family": { "default": "Fontin", "description": "The font family of the name in the header.", - "title": "Name Font Family" + "enum": [ + "Libertinus Serif", + "New Computer Modern", + "DejaVu Sans Mono", + "Mukta", + "Open Sans", + "Gentium Book Plus", + "Noto Sans", + "Lato", + "Source Sans 3", + "EB Garamond", + "Open Sauce Sans", + "Fontin", + "Roboto", + "Ubuntu", + "Poppins", + "Raleway", + "XCharter" + ], + "title": "Name Font Family", + "type": "string" }, "name_font_size": { "default": "25pt", @@ -3450,7 +3604,27 @@ "connections_font_family": { "default": "Fontin", "description": "The font family of the connections in the header.", - "title": "Connections Font Family" + "enum": [ + "Libertinus Serif", + "New Computer Modern", + "DejaVu Sans Mono", + "Mukta", + "Open Sans", + "Gentium Book Plus", + "Noto Sans", + "Lato", + "Source Sans 3", + "EB Garamond", + "Open Sauce Sans", + "Fontin", + "Roboto", + "Ubuntu", + "Poppins", + "Raleway", + "XCharter" + ], + "title": "Connections Font Family", + "type": "string" }, "separator_between_connections": { "default": null, @@ -3608,7 +3782,7 @@ "type": "string" } }, - "title": "NormalEntryOptions", + "title": "Normal Entry Options", "type": "object" }, "rendercv__themes__moderncv__SectionTitles": { @@ -3617,26 +3791,39 @@ "type": { "default": "moderncv", "description": "The type of the section titles.", - "title": "Line Type", - "oneOf": [ - { - "enum": [ - "with-partial-line", - "with-full-line", - "without-line", - "moderncv" - ], - "type": "string" - }, - { - "type": "null" - } - ] + "enum": [ + "with-partial-line", + "with-full-line", + "without-line", + "moderncv" + ], + "title": "Type", + "type": "string" }, "font_family": { "default": "Fontin", "description": "The font family of the section titles.", - "title": "Font Family" + "enum": [ + "Libertinus Serif", + "New Computer Modern", + "DejaVu Sans Mono", + "Mukta", + "Open Sans", + "Gentium Book Plus", + "Noto Sans", + "Lato", + "Source Sans 3", + "EB Garamond", + "Open Sauce Sans", + "Fontin", + "Roboto", + "Ubuntu", + "Poppins", + "Raleway", + "XCharter" + ], + "title": "Font Family", + "type": "string" }, "font_size": { "default": "1.4em", @@ -3675,7 +3862,7 @@ "type": "string" } }, - "title": "SectionTitles", + "title": "Section Titles", "type": "object" }, "rendercv__themes__moderncv__Text": { @@ -3684,7 +3871,27 @@ "font_family": { "default": "Fontin", "description": "The font family.", - "title": "Font Family" + "enum": [ + "Libertinus Serif", + "New Computer Modern", + "DejaVu Sans Mono", + "Mukta", + "Open Sans", + "Gentium Book Plus", + "Noto Sans", + "Lato", + "Source Sans 3", + "EB Garamond", + "Open Sauce Sans", + "Fontin", + "Roboto", + "Ubuntu", + "Poppins", + "Raleway", + "XCharter" + ], + "title": "Font Family", + "type": "string" }, "font_size": { "default": "10pt", @@ -3852,7 +4059,7 @@ "type": "string" } }, - "title": "EducationEntryOptions", + "title": "Education Entry Options", "type": "object" }, "rendercv__themes__options__Entries": { @@ -3937,7 +4144,7 @@ "type": "string" } }, - "title": "ExperienceEntryOptions", + "title": "Experience Entry Options", "type": "object" }, "rendercv__themes__options__Header": { @@ -3947,7 +4154,27 @@ "name_font_family": { "default": "Source Sans 3", "description": "The font family of the name in the header.", - "title": "Name Font Family" + "enum": [ + "Libertinus Serif", + "New Computer Modern", + "DejaVu Sans Mono", + "Mukta", + "Open Sans", + "Gentium Book Plus", + "Noto Sans", + "Lato", + "Source Sans 3", + "EB Garamond", + "Open Sauce Sans", + "Fontin", + "Roboto", + "Ubuntu", + "Poppins", + "Raleway", + "XCharter" + ], + "title": "Name Font Family", + "type": "string" }, "name_font_size": { "default": "30pt", @@ -3994,7 +4221,27 @@ "connections_font_family": { "default": "Source Sans 3", "description": "The font family of the connections in the header.", - "title": "Connections Font Family" + "enum": [ + "Libertinus Serif", + "New Computer Modern", + "DejaVu Sans Mono", + "Mukta", + "Open Sans", + "Gentium Book Plus", + "Noto Sans", + "Lato", + "Source Sans 3", + "EB Garamond", + "Open Sauce Sans", + "Fontin", + "Roboto", + "Ubuntu", + "Poppins", + "Raleway", + "XCharter" + ], + "title": "Connections Font Family", + "type": "string" }, "separator_between_connections": { "default": null, @@ -4155,7 +4402,7 @@ "type": "string" } }, - "title": "NormalEntryOptions", + "title": "Normal Entry Options", "type": "object" }, "rendercv__themes__options__Page": { @@ -4234,26 +4481,39 @@ "type": { "default": "with-partial-line", "description": "The type of the section titles.", - "title": "Line Type", - "oneOf": [ - { - "enum": [ - "with-partial-line", - "with-full-line", - "without-line", - "moderncv" - ], - "type": "string" - }, - { - "type": "null" - } - ] + "enum": [ + "with-partial-line", + "with-full-line", + "without-line", + "moderncv" + ], + "title": "Type", + "type": "string" }, "font_family": { "default": "Source Sans 3", "description": "The font family of the section titles.", - "title": "Font Family" + "enum": [ + "Libertinus Serif", + "New Computer Modern", + "DejaVu Sans Mono", + "Mukta", + "Open Sans", + "Gentium Book Plus", + "Noto Sans", + "Lato", + "Source Sans 3", + "EB Garamond", + "Open Sauce Sans", + "Fontin", + "Roboto", + "Ubuntu", + "Poppins", + "Raleway", + "XCharter" + ], + "title": "Font Family", + "type": "string" }, "font_size": { "default": "1.4em", @@ -4292,7 +4552,7 @@ "type": "string" } }, - "title": "SectionTitles", + "title": "Section Titles", "type": "object" }, "rendercv__themes__options__Text": { @@ -4302,7 +4562,27 @@ "font_family": { "default": "Source Sans 3", "description": "The font family.", - "title": "Font Family" + "enum": [ + "Libertinus Serif", + "New Computer Modern", + "DejaVu Sans Mono", + "Mukta", + "Open Sans", + "Gentium Book Plus", + "Noto Sans", + "Lato", + "Source Sans 3", + "EB Garamond", + "Open Sauce Sans", + "Fontin", + "Roboto", + "Ubuntu", + "Poppins", + "Raleway", + "XCharter" + ], + "title": "Font Family", + "type": "string" }, "font_size": { "default": "10pt", @@ -4468,7 +4748,7 @@ "type": "string" } }, - "title": "EducationEntryOptions", + "title": "Education Entry Options", "type": "object" }, "rendercv__themes__sb2nov__EntryOptionsTypes": { @@ -4525,7 +4805,7 @@ "title": "Publication Entry" } }, - "title": "EntryOptionsTypes", + "title": "Entry Types", "type": "object" }, "rendercv__themes__sb2nov__ExperienceEntryOptions": { @@ -4550,7 +4830,7 @@ "type": "string" } }, - "title": "ExperienceEntryOptions", + "title": "Experience Entry Options", "type": "object" }, "rendercv__themes__sb2nov__Header": { @@ -4559,7 +4839,27 @@ "name_font_family": { "default": "New Computer Modern", "description": "The font family of the name in the header.", - "title": "Name Font Family" + "enum": [ + "Libertinus Serif", + "New Computer Modern", + "DejaVu Sans Mono", + "Mukta", + "Open Sans", + "Gentium Book Plus", + "Noto Sans", + "Lato", + "Source Sans 3", + "EB Garamond", + "Open Sauce Sans", + "Fontin", + "Roboto", + "Ubuntu", + "Poppins", + "Raleway", + "XCharter" + ], + "title": "Name Font Family", + "type": "string" }, "name_font_size": { "default": "30pt", @@ -4606,7 +4906,27 @@ "connections_font_family": { "default": "New Computer Modern", "description": "The font family of the connections in the header.", - "title": "Connections Font Family" + "enum": [ + "Libertinus Serif", + "New Computer Modern", + "DejaVu Sans Mono", + "Mukta", + "Open Sans", + "Gentium Book Plus", + "Noto Sans", + "Lato", + "Source Sans 3", + "EB Garamond", + "Open Sauce Sans", + "Fontin", + "Roboto", + "Ubuntu", + "Poppins", + "Raleway", + "XCharter" + ], + "title": "Connections Font Family", + "type": "string" }, "separator_between_connections": { "default": null, @@ -4764,7 +5084,7 @@ "type": "string" } }, - "title": "NormalEntryOptions", + "title": "Normal Entry Options", "type": "object" }, "rendercv__themes__sb2nov__SectionTitles": { @@ -4773,26 +5093,39 @@ "type": { "default": "with-partial-line", "description": "The type of the section titles.", - "title": "Line Type", - "oneOf": [ - { - "enum": [ - "with-partial-line", - "with-full-line", - "without-line", - "moderncv" - ], - "type": "string" - }, - { - "type": "null" - } - ] + "enum": [ + "with-partial-line", + "with-full-line", + "without-line", + "moderncv" + ], + "title": "Type", + "type": "string" }, "font_family": { "default": "New Computer Modern", "description": "The font family of the section titles.", - "title": "Font Family" + "enum": [ + "Libertinus Serif", + "New Computer Modern", + "DejaVu Sans Mono", + "Mukta", + "Open Sans", + "Gentium Book Plus", + "Noto Sans", + "Lato", + "Source Sans 3", + "EB Garamond", + "Open Sauce Sans", + "Fontin", + "Roboto", + "Ubuntu", + "Poppins", + "Raleway", + "XCharter" + ], + "title": "Font Family", + "type": "string" }, "font_size": { "default": "1.4em", @@ -4833,24 +5166,17 @@ "line_type": { "default": "with-full-line", "description": "The type of the section titles.", - "title": "Line Type", - "oneOf": [ - { - "enum": [ - "with-partial-line", - "with-full-line", - "without-line", - "moderncv" - ], - "type": "string" - }, - { - "type": "null" - } - ] + "enum": [ + "with-partial-line", + "with-full-line", + "without-line", + "moderncv" + ], + "title": "Type", + "type": "string" } }, - "title": "SectionTitles", + "title": "Section Titles", "type": "object" }, "rendercv__themes__sb2nov__Text": { @@ -4859,7 +5185,27 @@ "font_family": { "default": "New Computer Modern", "description": "The font family.", - "title": "Font Family" + "enum": [ + "Libertinus Serif", + "New Computer Modern", + "DejaVu Sans Mono", + "Mukta", + "Open Sans", + "Gentium Book Plus", + "Noto Sans", + "Lato", + "Source Sans 3", + "EB Garamond", + "Open Sauce Sans", + "Fontin", + "Roboto", + "Ubuntu", + "Poppins", + "Raleway", + "XCharter" + ], + "title": "Font Family", + "type": "string" }, "font_size": { "default": "10pt", @@ -4905,8 +5251,7 @@ "properties": { "cv": { "$ref": "#/$defs/CurriculumVitae", - "description": "The content of the CV.", - "title": "CV" + "description": "The content of the CV." }, "design": { "default": { @@ -5057,8 +5402,7 @@ "render_command": null, "bold_keywords": [] }, - "description": "The settings of the RenderCV.", - "title": "RenderCV Settings" + "description": "The settings of the RenderCV." } }, "required": [], diff --git a/scripts/update_examples.py b/scripts/update_examples.py index f172072c..319d8fda 100644 --- a/scripts/update_examples.py +++ b/scripts/update_examples.py @@ -32,6 +32,9 @@ def generate_examples(): ) yaml_file_path = examples_directory_path / "John_Doe_CV.yaml" + # Remove the first line from the YAML file (Json Schema): + yaml_file_path.write_text(yaml_file_path.read_text().split("\n", 1)[1]) + # Rename John_Doe_CV.yaml proper_theme_name = theme.capitalize() + "Theme" new_yaml_file_path = ( diff --git a/tests/test_api.py b/tests/test_api.py index adbf3c04..0761a7e8 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1,6 +1,3 @@ -import pathlib -import tempfile - import rendercv import rendercv.data @@ -24,9 +21,9 @@ def test_create_contents_of_a_typst_file_with_errors( ) -def test_create_a_typst_file_from_a_yaml_string(input_file_path): +def test_create_a_typst_file_from_a_yaml_string(input_file_path, tmp_path): yaml_string = input_file_path.read_text() - output_file_path = pathlib.Path(tempfile.mktemp(suffix=".typst")) + output_file_path = tmp_path / "output.typ" errors = rendercv.create_a_typst_file_from_a_yaml_string( yaml_string, output_file_path ) @@ -35,9 +32,9 @@ def test_create_a_typst_file_from_a_yaml_string(input_file_path): def test_create_a_typst_file_from_a_python_dictionary( - rendercv_data_as_python_dictionary, + rendercv_data_as_python_dictionary, tmp_path ): - output_file_path = pathlib.Path(tempfile.mktemp(suffix=".typst")) + output_file_path = tmp_path / "output.typ" errors = rendercv.create_a_typst_file_from_a_python_dictionary( rendercv_data_as_python_dictionary, output_file_path ) @@ -60,9 +57,9 @@ def test_create_contents_of_a_markdown_file_from_a_python_dictionary( assert isinstance(result, str) -def test_create_a_markdown_file_from_a_yaml_string(input_file_path): +def test_create_a_markdown_file_from_a_yaml_string(input_file_path, tmp_path): yaml_string = input_file_path.read_text() - output_file_path = pathlib.Path(tempfile.mktemp(suffix=".md")) + output_file_path = tmp_path / "output.md" errors = rendercv.create_a_markdown_file_from_a_yaml_string( yaml_string, output_file_path ) @@ -71,9 +68,9 @@ def test_create_a_markdown_file_from_a_yaml_string(input_file_path): def test_create_a_markdown_file_from_a_python_dictionary( - rendercv_data_as_python_dictionary, + rendercv_data_as_python_dictionary, tmp_path ): - output_file_path = pathlib.Path(tempfile.mktemp(suffix=".md")) + output_file_path = tmp_path / "output.md" errors = rendercv.create_a_markdown_file_from_a_python_dictionary( rendercv_data_as_python_dictionary, output_file_path ) @@ -81,9 +78,9 @@ def test_create_a_markdown_file_from_a_python_dictionary( assert output_file_path.exists() -def test_create_an_html_file_from_a_yaml_string(input_file_path): +def test_create_an_html_file_from_a_yaml_string(input_file_path, tmp_path): yaml_string = input_file_path.read_text() - output_file_path = pathlib.Path(tempfile.mktemp(suffix=".html")) + output_file_path = tmp_path / "output.html" errors = rendercv.create_an_html_file_from_a_yaml_string( yaml_string, output_file_path ) @@ -92,9 +89,9 @@ def test_create_an_html_file_from_a_yaml_string(input_file_path): def test_create_an_html_file_from_a_python_dictionary( - rendercv_data_as_python_dictionary, + rendercv_data_as_python_dictionary, tmp_path ): - output_file_path = pathlib.Path(tempfile.mktemp(suffix=".html")) + output_file_path = tmp_path / "output.html" errors = rendercv.create_an_html_file_from_a_python_dictionary( rendercv_data_as_python_dictionary, output_file_path ) @@ -102,16 +99,18 @@ def test_create_an_html_file_from_a_python_dictionary( assert output_file_path.exists() -def test_create_a_pdf_from_a_yaml_string(input_file_path): +def test_create_a_pdf_from_a_yaml_string(input_file_path, tmp_path): yaml_string = input_file_path.read_text() - output_file_path = pathlib.Path(tempfile.mktemp(suffix=".pdf")) + output_file_path = tmp_path / "output.pdf" errors = rendercv.create_a_pdf_from_a_yaml_string(yaml_string, output_file_path) assert errors is None assert output_file_path.exists() -def test_create_a_pdf_from_a_python_dictionary(rendercv_data_as_python_dictionary): - output_file_path = pathlib.Path(tempfile.mktemp(suffix=".pdf")) +def test_create_a_pdf_from_a_python_dictionary( + rendercv_data_as_python_dictionary, tmp_path +): + output_file_path = tmp_path / "output.pdf" errors = rendercv.create_a_pdf_from_a_python_dictionary( rendercv_data_as_python_dictionary, output_file_path )