Book Image

Learning Flask Framework

Book Image

Learning Flask Framework

Overview of this book

Table of Contents (17 chapters)
Learning Flask Framework
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Simple editing with Markdown


Markdown is a now widely used mark-up language on the web. It allows you to write plain text in a special format that can be programmatically converted to HTML. This can be especially useful when editing text from a mobile device where, for example, highlighting text to make it bold is significantly trickier than on a PC. You can see how to use the Markdown syntax at http://daringfireball.net/projects/markdown/

Note

One interesting thing to note with Markdown is that you can still use HTML as well as Markdown at the same time.

Of course, to get this running is quick and simple in Python. We install it as follows:

sudo pip install Flask-Markdown

Then we can apply it to our blueprint or app as follows:

from flaskext.markdown import Markdown
Markdown(app)

This makes a new filter available in our templates called markdown and that can be used when rendering your template:

{{ entry.body | markdown }}

Now all you need to do is write and save your blog entry content in Markdown...