2023-09-10 19:54:36 +00:00
|
|
|
"""
|
|
|
|
This module is a script to run the RenderCV and generate a CV as a PDF.
|
|
|
|
"""
|
|
|
|
|
2023-09-09 15:25:28 +00:00
|
|
|
import os
|
|
|
|
|
|
|
|
from ruamel.yaml import YAML
|
|
|
|
|
|
|
|
from rendercv.data_model import RenderCVDataModel
|
2023-09-12 17:41:56 +00:00
|
|
|
from rendercv.rendering import render_template, run_latex
|
2023-09-09 15:25:28 +00:00
|
|
|
|
2023-09-12 17:41:56 +00:00
|
|
|
input_name = "personal"
|
2023-10-07 18:07:57 +00:00
|
|
|
workspace = os.path.dirname(__file__)
|
2023-09-10 19:54:36 +00:00
|
|
|
|
2023-09-12 17:41:56 +00:00
|
|
|
input_file_path = os.path.join(workspace, "tests", "inputs", f"{input_name}.yaml")
|
2023-09-10 19:54:36 +00:00
|
|
|
with open(input_file_path) as file:
|
|
|
|
yaml = YAML()
|
|
|
|
raw_json = yaml.load(file)
|
|
|
|
|
|
|
|
data = RenderCVDataModel(**raw_json)
|
2023-09-13 17:10:21 +00:00
|
|
|
output_latex_file=render_template(data=data)
|
2023-09-10 19:54:36 +00:00
|
|
|
|
2023-09-13 17:10:21 +00:00
|
|
|
run_latex(output_latex_file)
|