Created
May 16, 2012 20:41
-
-
Save josephmosby/2713770 to your computer and use it in GitHub Desktop.
markdown_parser.py
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
import markdown | |
import codecs | |
import sys | |
# First argument passed in must be an MD-compliant file. | |
# Second argument is the file to write to. | |
# For discussion, check here: https://gist.github.com/2713759 | |
md_file = codecs.open(sys.argv[1], mode='r', encoding='utf8') | |
md_input = md_file.read() | |
html = markdown.markdown(md_input) | |
html_output = codecs.open(sys.argv[2], mode='w', encoding='utf8') | |
html_output.write(html) | |
md_file.close() | |
html_output.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment