11 lines
327 B
Python
11 lines
327 B
Python
|
import json
|
||
|
|
||
|
def gen_doc(template: str, vars: dict) -> str:
|
||
|
definition = json.loads(open(f"{template}.json").read())
|
||
|
content = open(f"{template}.html").read()
|
||
|
|
||
|
for var in definition["vars"]:
|
||
|
var_r = var["name"].upper()
|
||
|
content = content.replace(f"[[{var_r}]]", vars[var["name"]])
|
||
|
|
||
|
return content
|