Skip to content

Instantly share code, notes, and snippets.

@josephmosby
Created May 16, 2012 20:41
Show Gist options
  • Save josephmosby/2713770 to your computer and use it in GitHub Desktop.
Save josephmosby/2713770 to your computer and use it in GitHub Desktop.
markdown_parser.py
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