11 lines
No EOL
327 B
Python
Executable file
11 lines
No EOL
327 B
Python
Executable file
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 |