update rendercv.api.create_contents_of_a_typst_file

This commit is contained in:
Sina Atalay
2025-01-25 17:58:52 -05:00
parent d347bc88e5
commit f3c85480c1

View File

@@ -9,15 +9,14 @@ from .. import data, renderer
def create_contents_of_a_typst_file(
input_file_as_a_dict: dict,
yaml_file_as_string: str,
) -> str | list[dict]:
"""
Validate the input file given as a dictionary, generate a Typst file and return it
as a string. If there are any validation errors, return them as a list of
dictionaries.
Validate the input file given as a string, generate a Typst file and return it as a
string. If there are any validation errors, return them as a list of dictionaries.
Args:
input_file_as_a_dict: The input file as a dictionary.
yaml_file_as_string: The input file as a string.
Returns:
The Typst file as a string or a list of dictionaries that contain the error
@@ -25,6 +24,7 @@ def create_contents_of_a_typst_file(
"""
try:
input_file_as_a_dict = data.read_a_yaml_file(yaml_file_as_string)
data_model = data.validate_input_dictionary_and_return_the_data_model(
input_file_as_a_dict,
)