Grotti 2.2.1: Anleitungen mit relativen Pfaden für Git-Vorschau.

This commit is contained in:
Dominic Gundel committed 2026-10-15 10:54:45 +02:00
1 parent 5a3716b26a
commit 7da895bbcd
12 files changed
+51 -37

No files matched your search

+8
View File
@@ -519,7 +519,15 @@ def create_app(cfg):
return labels.get(name, name.replace("Anleitung-", "").replace("-", " "))
def render_markdown(path):
"""Markdown für die App: Git-relative Bild-/Kapitelpfade → App-URLs."""
text = path.read_text(encoding="utf-8")
# docs/… → web/static/… im Repo; unter /doku als /static/…
text = text.replace("../web/static/", "/static/")
text = re.sub(
r"\]\((Anleitung-[A-Za-z0-9_-]+)(?:\.md)?\)",
r"](/doku/\1)",
text,
)
html = markdown.markdown(text, extensions=["tables", "fenced_code", "sane_lists"])
return Markup(html)