def markdown_to_platypus(path):
"Convert a specific MarkDown file into ReportLab Platypus items."
cover, qa = extract_markdown(path)
title, paras = cover
cover = [Paragraph(title, h1)] + [Paragraph(p, bt) for p in paras]
items = [{"q": Paragraph(q, bt),
"a": XPreformatted(pygments2xpre(a), code)} for q, a in qa]
return cover, items
评论列表
文章目录