layout tweaks

This commit is contained in:
anarsec 2023-07-15 18:06:18 +00:00
parent 6f33bc5e8d
commit f4c50a476e
No known key found for this signature in database
7 changed files with 62 additions and 45 deletions

View file

@ -108,6 +108,10 @@ class Converter:
# Copy the back image
back_image = pathlib.Path(workingDirectory) / "back_image.png"
shutil.copy(self.anarsec_root / "static" / "images" / "gay.png", back_image)
# Copy the header font
header_font = pathlib.Path(workingDirectory) / "Jost-Medium.ttf"
shutil.copy(self.anarsec_root / "static" / "fonts" / "Jost-Medium.ttf", header_font)
# Add recommendations to the Markdown content
recommendations = re.search(r'\+{3}.*?\+{3}(.*)', recommendations_file.open().read(), re.MULTILINE | re.DOTALL).group(1)
@ -170,6 +174,9 @@ class Converter:
# Convert the full typst file to PDF
pdf_path = pathlib.Path(workingDirectory) / f"{self.post_id}.pdf"
os.environ["TYPST_FONT_PATHS"] = str(workingDirectory)
subprocess.check_call(
[str(self.typst_binary), "--root", workingDirectory, "compile", full_typst_path, pdf_path],
stderr = subprocess.STDOUT