Skip to content

Instantly share code, notes, and snippets.

@swshan
Created September 17, 2015 02:34
Show Gist options
  • Save swshan/1b44d383b973e4451317 to your computer and use it in GitHub Desktop.
Save swshan/1b44d383b973e4451317 to your computer and use it in GitHub Desktop.
Python flask exercise
# We import the markdown library
import markdown
from flask import Flask
from flask import render_template
from flask import Markup
app = Flask(__name__)
@app.route('/')
def index():
content = """
Chapter
=======
Section
-------
* Item 1
* Item 2
> this is a quote
>> inner quote
"""
content = Markup(markdown.markdown(content))
return render_template('index.html', **locals())
app.run(debug=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment