import typst
import json



def compile_pdf(data: dict):
    data = {"computer": json.dumps(data)}
    try:
        res = typst.compile(input="files/main.typ", sys_inputs=data)
    except RuntimeError as e:
        print(e)
        print("Error compiling")
        return False
    print(res)
