feature: add photos

This commit is contained in:
Prof. Dr. Matthias Jung DL9MJ
2025-05-13 23:25:09 +02:00
parent 0a7b885702
commit 0236f65bce
3 changed files with 50 additions and 8 deletions
+19
View File
@@ -0,0 +1,19 @@
import re
from mistletoe.span_token import SpanToken
class Photo(SpanToken):
"""
Span token for photos.
Example: [photo:123:n_wasserfalldiagramm_trx_collage:Ansichten verschiedener Transceiver]
"""
parse_inner = False
pattern = re.compile(r"\[photo:(\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"