예제 #1
0
def parseContents(data):
	"""Run the content through the markdown parser and my own parsing"""
	parsed = []
	for x in data.split("\n\n"):
		if not x.strip():
			continue

		# Comments
		if x[0:4] == '<!--':
			continue
		if x[0:5] == '-----':
			continue

		x = markupFirst(x)

		parsed.append(markdown.markdown(x))

	output = header + "\n"
	for x in parsed:
		x = markupAfter(x)
		output += x + "\n" #secHeader + x + secFooter + "\n"

	output += footer
	return output
예제 #2
0
def format_markdown(value, arg=None):
    return markdown2.markdown(value)
예제 #3
0
def format_markdown(value, arg=None):
  return markdown2.markdown(value)
예제 #4
0
파일: views.py 프로젝트: woshihehao/Blog-1
def content(request, blogTitle):
    blogTitle = re.sub(r"_", r" ", blogTitle)
    post = article.objects.get(title=blogTitle)
    post.content = markdown2.markdown(post.content)
    dict = {"blog": post}
    return render_to_response("content.html", dict, context_instance=RequestContext(request, processors=[temp_proc]))
예제 #5
0
파일: views.py 프로젝트: woshihehao/Blog-1
def render_post(post):
    post.content = markdown2.markdown(post.content)
    return post