Created
May 20, 2013 22:15
-
-
Save garbados/5616037 to your computer and use it in GitHub Desktop.
Use like this: `cat [filename].md | md2flask` It kicks up a Flask server that renders the markdown as HTML for your viewing pleasure. Change `/usr/bin/python` to whatever your terminal returns for `which python`, run `chmod +x md2flask`, add it to your $PATH, do a little dance, make a little love, and you should be alright.
This file contains 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
#!/usr/bin/python | |
import flask | |
import markdown | |
import sys | |
app = flask.Flask(__name__) | |
md = sys.stdin.read() | |
@app.route('/') | |
def index(): | |
return markdown.markdown(md) | |
if __name__ == '__main__': | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment