From 4c6a1c2f77f5cf5b187911256c9de7b72fe1b65e Mon Sep 17 00:00:00 2001 From: FreeArtMan Date: Sun, 21 May 2017 17:44:48 +0100 Subject: Added image markdown custom renderer --- src/md.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/md.py b/src/md.py index 8c131a4..31d5e9e 100755 --- a/src/md.py +++ b/src/md.py @@ -29,6 +29,7 @@ class TocMixin(): self.toc_tree = [] self.toc_count = 0 self.title = None + self.img_count = -1 def header(self, text, level, raw=None): rv = "" @@ -42,6 +43,13 @@ class TocMixin(): self.toc_count += 1 return rv + #Lets do previev image + def image(self, src, title, alt_text): + prev_img = src.split(".") + prev_img = prev_img[0]+"_prev."+prev_img[1] + self.img_count += 1 + return "\""+alt_text+"\"" + def render_toc(self, level=3): """Render TOC to HTML. -- cgit v1.2.3