diff options
author | FreeArtMan <dos21h@gmail.com> | 2017-05-21 17:44:48 +0100 |
---|---|---|
committer | FreeArtMan <dos21h@gmail.com> | 2017-05-21 17:44:48 +0100 |
commit | 4c6a1c2f77f5cf5b187911256c9de7b72fe1b65e (patch) | |
tree | faadb9afa4dd884bae0f7300e0e5499c98be0a43 | |
parent | 0e3bf8fe600072a715764a150dc3c27b6e57da58 (diff) | |
download | md-site-4c6a1c2f77f5cf5b187911256c9de7b72fe1b65e.tar.gz md-site-4c6a1c2f77f5cf5b187911256c9de7b72fe1b65e.zip |
Added image markdown custom renderer
-rwxr-xr-x | src/md.py | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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 "<a href="+src+"><img src=\""+prev_img+"\" alt=\""+alt_text+"\"></a>" + def render_toc(self, level=3): """Render TOC to HTML. |