Files
latex/build/build.py
2026-02-19 17:04:45 +01:00

48 lines
2.4 KiB
Python

import os
from typing import List
import labels
import datetime
version = "1.0.0"
print("""
▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄▄▄▄▄▄ ▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄
█ █ █ █ █ █ █▄█ █ █ █ █ █ █ █ █ █ █ ▄ █ █ █
█ █ █ ▄ █▄ ▄█ ▄▄▄█ █ █ █▄█ █ ▄▄▄█ █ █ ▄ █ ▄▄▄█ █ █ █ █ ▄▄▄▄▄█
█ █ █ █▄█ █ █ █ █ █▄▄▄█ █ █ █ █▄▄▄█ █ █ █▄█ █ █▄▄▄█ █▄▄█▄█ █▄▄▄▄▄
█ █▄▄▄█ █ █ █ █ ▄▄▄██ █ █ ▄ █ ▄▄▄█ █▄▄▄█ ▄▄▄█ ▄▄▄█ ▄▄ █▄▄▄▄▄ █
█ █ ▄ █ █ █ █ █▄▄▄█ ▄ █ █ █ █ █ █▄▄▄█ █ █ █ █▄▄▄█ █ █ █▄▄▄▄▄█ █
█▄▄▄▄▄▄▄█▄█ █▄▄█ █▄▄▄█ █▄▄▄▄▄▄▄█▄▄█ █▄▄█ █▄▄█ █▄▄█▄▄▄▄▄▄▄█▄▄▄▄▄▄▄█▄▄▄█ █▄▄▄▄▄▄▄█▄▄▄█ █▄█▄▄▄▄▄▄▄█
""")
def load_all_files_of_array(dirname: str, files: List[str]):
data = ""
for filename in files:
with open(dirname + "/" + filename, "r") as file:
data += file.read() + "\n\n"
return data
output = load_all_files_of_array("../src/", ["header.sty", "core.sty"])
output += load_all_files_of_array("../src/config/", os.listdir("../src/config/"))
output += load_all_files_of_array("../src/", ["style.sty"])
output += load_all_files_of_array("../src/core/", os.listdir("../src/core/"))
output += load_all_files_of_array("../src/style/", os.listdir("../src/style/"))
l = labels.generate_labels()
output += l[0] + "\n\n"
output += l[1]
with open("../janishutz-helpers.tex", "w") as file:
file.write(output)
with open("../janishutz-helpers.sty", "w") as file:
file.write(output)
print("==> Built successfully. Output to project-root/janishutz-helpers.tex\n")