(md_file)
| 20 | |
| 21 | |
| 22 | def md_to_html(md_file): |
| 23 | if not os.path.isfile(md_file): |
| 24 | print(f"文件 {md_file} 不存在。") |
| 25 | return None |
| 26 | with open(md_file, 'r', encoding='utf-8') as f: |
| 27 | md_text = f.read() |
| 28 | html_text = markdown.markdown(md_text, extensions=['tables']) |
| 29 | return html_text |
| 30 | |
| 31 | |
| 32 | # 生产HTML内容 |
no outgoing calls
no test coverage detected