fix: fixed a wrong merge

This commit is contained in:
Prof. Dr. Matthias Jung DL9MJ
2025-06-24 22:07:23 +02:00
committed by Tim Grelka
parent 4c119c86bb
commit 857afc094d
+7 -3
View File
@@ -283,7 +283,11 @@ class Build:
with open("data/snippets.json") as f: with open("data/snippets.json") as f:
snippets = json.load(f) snippets = json.load(f)
with FiftyOhmHtmlRenderer(self.__build_question, self.__picture_handler, self.__photo_handler) as renderer: with FiftyOhmHtmlRenderer(
question_renderer=self.__build_question,
picture_handler=self.__picture_handler,
photo_handler=self.__photo_handler
) as renderer:
for key, value in snippets.items(): for key, value in snippets.items():
snippets[key] = renderer.render_inner(Document(value)) snippets[key] = renderer.render_inner(Document(value))
# Remove leading <p> and trailing </p>: # Remove leading <p> and trailing </p>:
@@ -296,7 +300,7 @@ class Build:
return contents return contents
def __build_index(self, snippets): def __build_index(self, snippets):
template = self.env.get_template("index.html") template = self.env.get_template("html/index.html")
result = template.render({"snippets": snippets}) result = template.render({"snippets": snippets})
with open("build/index.html", "w") as file: with open("build/index.html", "w") as file:
@@ -305,7 +309,7 @@ class Build:
file.write(result) file.write(result)
def __build_course_page(self, snippets, template, page): def __build_course_page(self, snippets, template, page):
template = self.env.get_template(f"{template}.html") template = self.env.get_template(f"html/{template}.html")
result=template.render({"snippets": snippets}) result=template.render({"snippets": snippets})
with open(f"build/{page}.html", "w") as file: with open(f"build/{page}.html", "w") as file: