Add Markdown support

This commit is contained in:
Gregory Soutade
2014-01-04 13:43:38 +01:00
parent 9de9cea99a
commit 88e6ebd3a4
11 changed files with 2521 additions and 12 deletions

View File

@@ -165,6 +165,7 @@ class Index(DynastieGenerator):
return code
def createPost(self, posts, dom, post_elem, root):
from dynastie.models import Post
post = self.cur_post_obj
if post.id in self.hash_posts and not self.first_try:
@@ -191,6 +192,9 @@ class Index(DynastieGenerator):
f = open(filename, 'rb')
post_content = f.read()
f.close()
if post.content_format == Post.CONTENT_TEXT:
from dynastie.generators import markdown2
post_content = markdown2.markdown(post_content)
self.hash_posts_content[filename] = post_content
else:
post_content = self.hash_posts_content[filename]

2320
generators/markdown2.py Normal file

File diff suppressed because it is too large Load Diff