def read_md(file):
try:
# noinspection PyPackageRequirements,PyUnresolvedReferences
from pypandoc import convert
return convert(file, 'rst', 'md')
except ImportError:
import warnings
warnings.warn('pypandoc module not found, could not convert Markdown to RST')
with open(file, 'r') as md:
return md.read()
评论列表
文章目录