Skip to content

Commit

Permalink
das ist stupid
Browse files Browse the repository at this point in the history
  • Loading branch information
9551-Dev committed Apr 3, 2024
1 parent 530fe2d commit f178ef0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion config/tubes/general.ini
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ project_index_name = index.html
root_index_name = index.html
[Embed]
image = https://zap.devvie.cc/gal/tubes/general/images/gu50%20pentode/gu50_4.jpg
image = https://zap.devvie.cc/gal/tubes/general/images/gu50%%20pentode/gu50_4.jpg
url =
title = Vacuum Tubes gallery
description = All stuff tube related that was not worth its own category
Expand Down
19 changes: 9 additions & 10 deletions gallery_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,16 @@ def handleMatch(self,m,data):

class markdown_custom_style_text(InlineProcessor):
def handleMatch(self,m,data):
styles = m.group(1).replace("=", ":")
text = m.group(2)
el = etree.Element("span")
styles = m.group(1).replace("=",":")
text = m.group(2)
el = etree.Element("span")
el.text = text
el.set("style", styles)
return el, m.start(0), m.end(0)
el.set("style",styles)
return el,m.start(0),m.end(0)

class markdown_custom_block_style_text(InlineProcessor):
def handleMatch(self,m,data):
styles = m.group(1).replace("=", ":")
styles = m.group(1).replace("=",":")
text = m.group(2)
el = etree.Element("div")
el.text = text
Expand All @@ -85,7 +85,7 @@ def handleMatch(self,m,data):
class markdown_url_processor(InlineProcessor):
def handleMatch(self,m,data):
url = m.group(0)
el = etree.Element("a")
el = etree.Element("a")
el.text = url
el.set("href", url)
return el,m.start(0),m.end(0)
Expand Down Expand Up @@ -119,16 +119,15 @@ def extendMarkdown(self, md):
LINK_PATTERN = r'(?<!\!)\b(?:https?|http|ftp|sftp):\/\/[-A-Za-z0-9+&@#\/%?=~_|!:,.;]*[-A-Za-z0-9+&@#\/%=~_|]'
md.inlinePatterns.register(markdown_url_processor(LINK_PATTERN,md),"embedded_link", 175)


class markdown_image_mixin(InlineProcessor):
def __init__(self,pattern,md,images):
super().__init__(pattern,md)
self.images = images

def handleMatch(self, m, data):
el = etree.Element("img")
el.set("src", m.group(2))
el.set("alt", m.group(1))
el.set("src",m.group(2))
el.set("alt",m.group(1))

if os.path.normpath(m.group(2)) in self.images:
el.set("onclick", f"open_image_viewer(\"{m.group(2)}\",true)")
Expand Down

0 comments on commit f178ef0

Please sign in to comment.