def save_part(lines):
"""save last part on rst file"""
# has content ?
if len(lines) > 2:
# get path
title = lines[0].replace(' ', '_')
path = os.path.join(README_DOC_PATH, '%s.rst' % title)
# get content
content = '\n'.join(lines[:-2])
content = content.replace('docs/img/', ' ../img/')
print(content)
# save
pypandoc.convert_text(content, 'rst', format='md', outputfile=path)
# flush last part
return lines[-2:]
# create directory
评论列表
文章目录