mirror of
https://github.com/rendercv/rendercv.git
synced 2026-04-24 00:47:28 -04:00
update rendercv.api.create_contents_of_a_typst_file
This commit is contained in:
@@ -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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user