def convert_markdown_file(input_file):
# input_file = 'README.md'
output_file = input_file.split('.')[0]
with open(input_file, 'r') as rhandler:
# markdown
mdcontent = rhandler.read()
marked_content, quotes = fix_quotes(mdcontent)
# HTML
html = markdown(marked_content)
# text
marked_text = html2text.html2text(html)
text = fix_text(marked_text, quotes)
with open(output_file, 'w') as whandler:
whandler.write(text)
评论列表
文章目录