Merge branch 'main' into feature/brightspots

This commit is contained in:
Tim Grelka
2026-02-15 13:22:23 +01:00
committed by GitHub
2 changed files with 165 additions and 68 deletions
+11 -3
View File
@@ -1,5 +1,6 @@
import json
import random
import re
import shutil
from pathlib import Path
@@ -124,8 +125,7 @@ class Build:
page_template = self.env.get_template("html/page.html")
return page_template.render(content=content, course_wrapper=course_wrapper, sidebar=sidebar)
def __picture_handler(self, id):
self.config.p_build_pictures.mkdir(parents=True, exist_ok=True)
def __copy_picture(self, id):
file = f"{id}.svg"
try:
shutil.copyfile(self.config.p_data_pictures / file, self.config.p_build_pictures / file)
@@ -136,6 +136,10 @@ class Build:
except FileNotFoundError:
tqdm.write(f"\033[31mPicture #{id} not found\033[0m")
def __picture_handler(self, id):
self.config.p_build_pictures.mkdir(parents=True, exist_ok=True)
return self.__copy_picture(id)
def __photo_handler(self, id):
self.config.p_build_photos.mkdir(parents=True, exist_ok=True)
file = f"{id}.png"
@@ -170,7 +174,11 @@ class Build:
def __include_handler(self, include):
with (self.config.p_data_html / f"{include}.html").open() as file:
return file.read()
code = file.read()
svg_list = re.findall(r"(\d+)\.svg", code or "")
for id in svg_list:
self.__copy_picture(id)
return code
def __build_section(
self,