refactor: avoid parsing document twice for figure numbers

This commit is contained in:
Tim Grelka
2026-06-24 16:18:39 +02:00
parent c15b3f709b
commit f6ceb4cf49
32 changed files with 263 additions and 349 deletions
+17
View File
@@ -1,2 +1,19 @@
from renderer.document import Document
from renderer.fifty_ohm_html_renderer import FiftyOhmHtmlRenderer
from renderer.fifty_ohm_html_slide_renderer import FiftyOhmHtmlSlideRenderer
def paragraph(text):
return f"<p>{text}</p>\n"
def render_html(markdown):
"""Render markdown with the HTML renderer through the project's Document."""
with FiftyOhmHtmlRenderer() as renderer:
return renderer.render(Document(markdown))
def render_slide(markdown):
"""Render markdown with the slide renderer through the project's Document."""
with FiftyOhmHtmlSlideRenderer() as renderer:
return renderer.render(Document(markdown))