Skip to content

Instantly share code, notes, and snippets.

@tkalus
tkalus / app.py
Created March 13, 2022 22:15
Flask render markdown with live-reload
#!/usr/bin/env python3
"""
Render a markdown file into HTML via Flask app on localhost.
Includes live-reload using HTTP long polling and a bit of vanilla JS.
Made pretty with https://picocss.com
[1]$ pip install Flask Flask-Caching Flask-Markdown requests
[1]$ flask run
[2]$ open http://localhost:5000/README.md