return self.text2html()
if hasattr(self, "body_rst"):
return self.rst2html()
+ if hasattr(self, "body_mkd"):
+ return self.mkd2html()
def text2html(self):
body = re.sub(url_re, _url2href, self.body_text())
parts = [part for part in (title, subtitle, body) if part]
return "\n\n".join(parts)
+ def mkd2html(self):
+ from markdown import markdown
+ return markdown(self.body_mkd(), output_format="html")
def img_thumbnail_800_1024(self, img_name):
return """\