Created
April 8, 2013 17:08
-
-
Save atupal/5338506 to your computer and use it in GitHub Desktop.
two way to use mark down in python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
first way: | |
{{ content }} | |
second way: | |
{% filter markdown %} | |
Your Markdown | |
============= | |
{% endfilter %} | |
or: | |
{{ mkd|markdown }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from application import app | |
import markdown | |
from flask import render_template | |
from flask import Markup | |
from flaskext.markdown import Markdown | |
Markdown(app) | |
@app.route("/blog") | |
def blog(): | |
content = open(app.config['APPLICATION_ROOT_DIR'] + 'tests/test_post.markdown', 'r').read() | |
return render_template('views/blog.html', content = content) | |
#content = Markup(markdown.markdown(content)) | |
#return render_template('views/blog.html', **locals()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment