def md2html(content, to_file):
import pypandoc
if os.path.isfile(content):
content = open(content).read()
if not os.path.splitext(to_file)[1] == '.html':
to_file += '.html'
output = pypandoc.convert_text(content, 'html', format = 'md')
with open(to_file, 'w') as f:
f.write(output)
评论列表
文章目录