First draft for pictures

This commit is contained in:
Prof. Dr. Matthias Jung DL9MJ
2025-02-26 21:23:03 +01:00
parent 8781a9954a
commit 09758ad306
3 changed files with 61 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
import re
from mistletoe.span_token import SpanToken
class Picture(SpanToken):
"""
Span token for pictures.
Example: [picture:727:amplitude_periode_halbwellen:Positive und negative Halbwellen einer Sinusschwingung]
"""
parse_inner = False
pattern = re.compile(r"\[picture:(\d+):(.+):(.+)\]")
def __init__(self, match_object):
self.id = match_object.group(1)
self.ref = match_object.group(2)
self.text = match_object.group(3)
self.number = "TODO"