converter.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:utils 作者: rapydo 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号