Add Markdown support
This commit is contained in:
@@ -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
2320
generators/markdown2.py
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user