Merge branch 'main' into feature/slides

This commit is contained in:
Prof. Dr. Matthias Jung DL9MJ
2025-06-24 22:09:48 +02:00
committed by Tim Grelka
8 changed files with 89 additions and 33 deletions
+14 -1
View File
@@ -8,6 +8,7 @@ from mistletoe import Document, HtmlRenderer
from .comment import BlockComment
from .dash import Dash
from .halfwidth_spaces import HalfwidthSpaces
from .include import Include
from .morse import Morse
from .nonbreaking_spaces import NonbreakingSpaces, NonbreakingSpacesDots
from .photo import Photo
@@ -30,7 +31,14 @@ class FiftyOhmHtmlRenderer(HtmlRenderer):
section_url = "section.html"
ref_id = 0
def __init__(self, *extras, question_renderer=None, picture_handler=None, photo_handler=None):
def __init__(
self,
*extras,
question_renderer=None,
picture_handler=None,
photo_handler=None,
include_handler=None
):
final_extras = chain(extras,(
Dash,
@@ -49,6 +57,7 @@ class FiftyOhmHtmlRenderer(HtmlRenderer):
Photo,
Table,
Qso,
Include,
))
super().__init__(*final_extras)
@@ -56,6 +65,7 @@ class FiftyOhmHtmlRenderer(HtmlRenderer):
self.question_renderer = question_renderer
self.picture_handler = picture_handler
self.photo_handler = photo_handler
self.include_handler = include_handler
def render_dash(self, token):
return " – "
@@ -233,3 +243,6 @@ class FiftyOhmHtmlRenderer(HtmlRenderer):
table += "</table>"
return table
def render_include(self, token):
return self.include_handler(token.ident)