title: Flask and Markdown, I love you! author: depierre published: 2013-12-08 categories: Blog keywords: blog, internship, intern, societe generale Good morning fellows! Since a couple of weeks, I was working on this new version of my blog. I wasn't fulfil anymore with the previous one. The main problem was the way I had to write the posts. In fact, I got annoyed having to use a web interface to edit a post. Before, I had to write into a html text area, which means with all the different HTML attributes (p, h1, h2, a, etc.). But then, I discovered [Markdown](http://daringfireball.net/projects/markdown/), or re-discovered it in fact. First I thought that Markdown was just for fun. I mean that it was more like a good joke than a real syntax format. It was just too simple to be true. After a couple of time using it, I just couldn't stop anymore! I felt like when some friends taught me [Latex](http://www.latex-project.org/), but __a thousand times better__! Well, I wrote this version of the blog from scratch. And this post tries to details the main changes. # New A couple of things are new here: 1. __Static pages__ thanks to [Flask-FlatPages](http://pythonhosted.org/Flask-FlatPages/) and Markdown (my new love). Therefore, every single article is written (and [available](../md/flask_and_markdown_i_love_you/)) in Markdown \o/ 2. A __comment section__ thanks to [html5lib](https://github.com/html5lib/html5lib-python) and Markdown (again!) You can now post comments under the articles. More, they support Markdown syntax __and__ [Pygments](http://pygments.org/) highlights! They are of course sanitized (I hope they really are...) thanks to html5lib. I activate the [CSRF](https://en.wikipedia.org/wiki/Cross-site_request_forgery) protection too. 3. A __preview system__ for each article. Hope it will help you to find the article you want. 4. A __pagination system__ at the bottom if you want to navigate through the pages. # Deleted Among the things I have removed, there are: 1. No more _FlaskAdmin_. There is no need for me to connect on the blog. I just have to move the markdown version of my article into the right directory. 2. __No more JavaScript__ in the whole blog (there was some in the ex-categories section). It was useless to force users to enable JS just for the categories... And dangerous because you should let that JS disabled, for __everything__! # Design 1. Move from _BootStrap2_ to [BootStrap3](http://getbootstrap.com/). 2. Navigation menues on your left. + A calendar is available. I hope it is more useful than the table like before. + The categories are available too. + Tags are available for each article. I hope these changes will help you navigate through the different contents. # Misc I just bought a fresh new domain name for the blog: [depier.re](https://depier.re) Some articles are missing for now. Either I judged them useless at the end, or I am rewriting them. Most of them are online on this version. But the ones about PTS are not for instance. The reason is that I am currently working on them. # What's next? For this blog, I will order a real SSL certificate (not a self-signed one :/). When I will do that, I will then activate the [HSTS](https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security) protocol (HTTP Strict Transport Security). Except that, I have no idea. I am fulfil with this current setup and I don't think that I will change it in the next 6 months (like the previous one ^^). Have a good day and see you!