编辑 GUID:86f4024a-e1c0-42b1-a191-e10d5cb400d7
编辑 UTC 日期和时间: 2025-01-02T06:01:30Z
编辑 UNIX 时间戳:1735797694
Markdown语法转HTML代码
import markdown import os
def convert_markdown_to_html(input_file, output_file):
# 读取 Markdown 文件内容
with open(input_file, ‘r’, encoding=’utf-8’) as f:
markdown_content = f.read()# 使用 markdown 库将 Markdown 内容转换为 HTML html_content = markdown.markdown(markdown_content) # 将 HTML 内容写入到输出文件 with open(output_file, 'w', encoding='utf-8') as f: f.write(html_content)
def get_desktop_path():
# 获取当前用户的桌面路径
return os.path.join(os.path.join(os.environ[‘USERPROFILE’]), ‘Desktop’)if name == “main“:
# 输入 Markdown 文件路径
input_file = ‘/Users/Administrator/Desktop/input.md’# 输出 HTML 文件路径,保存在桌面上 output_file = os.path.join(get_desktop_path(), '/Users/Administrator/Desktop/input.html') # 执行转换 convert_markdown_to_html(input_file, output_file)
print(f”HTML 文件已保存到: {output_file}”)
• 博客评论系统使用的是GitHub的issues,用户评论只需要登录你的GitHub账号即可评论
• 博客文章,可以直接在评论区进行相关的评论
• 博客文章,如果需要进一步交流讨论的,可以加入Telegram频道以及Telegram群组
Telegram群组[点击下方链接即可跳转Telegram群组页面]
Telegram频道[点击下方链接即可跳转Telegram频道页面]
文章Bug反馈
• 对文章提出Bug可以点击上方链接进行Bug反馈的直达,如果不会参照Bug反馈格式例子自己编写Markdown代码的话,可以复制下面提供的代码进行Bug的提交,只有在按照Bug反馈格式进行提交的Bug才会进行处理,否则不处理
Bug反馈例子 Markdown 源码
|Bug名称|Bug链接指向|Bug严重性|Bug是否已修复|
|-|-|-|-|
|-|-|-|-|