Created
June 21, 2013 20:31
-
-
Save tippenein/5834109 to your computer and use it in GitHub Desktop.
md to html
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/env python | |
import markdown | |
import sys | |
import codecs | |
if __name__ == '__main__': | |
in_file = codecs.open(sys.argv[1], mode="r", encoding="utf-8") | |
text = input_file.read() | |
html = markdown.markdown(text) | |
outname = sys.argv[1] + ".html" | |
out_file = codecs.open(outname, "w", encoding="utf-8", errors="xmlcharrefreplace") | |
out_file.write(html) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment