]> git.phdru.name Git - phdru.name/phdru.name.git/blobdiff - phd.py
m_lib has been published, move on
[phdru.name/phdru.name.git] / phd.py
diff --git a/phd.py b/phd.py
index 1e34234998a569fbe621cc7256bdd76c521044ed..19394839d9ebef92aca3173f3cdc708c34875f71 100644 (file)
--- a/phd.py
+++ b/phd.py
@@ -9,7 +9,7 @@ def _url2href(match):
    return '<a href="%s">%s</a>' % (url, url)
 
 
-full_dirs = len(os.getcwd().split('/')) + 2
+full_dirs = len(os.getcwd().split('/')) + 1
 
 class phd(Template):
    def __init__(self, *args, **kw):
@@ -44,6 +44,8 @@ class phd(Template):
          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())
@@ -81,6 +83,9 @@ class phd(Template):
       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 """\