feature: build slide index

This commit is contained in:
Prof. Dr. Matthias Jung DL9MJ
2025-06-24 22:04:42 +02:00
committed by Tim Grelka
parent 42cfe5407d
commit fe7d0f722a
2 changed files with 20 additions and 0 deletions
+11
View File
@@ -221,6 +221,16 @@ class Build:
result = self.__build_page(result)
result = BeautifulSoup(result, "html.parser").prettify()
file.write(result)
def __build_slide_index(self, book):
template = self.env.get_template("slide/slide_index.html")
with open(f"build/{book['edition']}_slide_index.html", "w") as file:
result = template.render(
book=book,
)
result = self.__build_page(result)
result = BeautifulSoup(result, "html.parser").prettify()
file.write(result)
def build_edition(self, edition):
edition = edition.upper()
@@ -230,6 +240,7 @@ class Build:
chapters = book["chapters"]
edition_name = book["title"]
self.__build_book_index(book)
self.__build_slide_index(book)
for number, chapter in enumerate(tqdm(chapters, desc=f"Build Edition: {edition}"),1):
next_chapter = chapters[number] if number < len(chapters) else None
self.__build_chapter(edition, edition_name, number, chapter, next_chapter)