markdown-to-pdf

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Markdown to PDF

Markdown转PDF

  • Use this skill when a user asks to convert a Markdown file to PDF.
  • Use the script at .github/skills/markdown-to-pdf/scripts/md_to_pdf.py for the conversion.
  • The default body font size is 11pt in the script; adjust the CSS if needed.
  • before installing dependencies ask if there is a proxy configuration required, if so apply proxy before installing dependencies.
  • Install dependencies if missing:
    python3 -m pip install markdown weasyprint
    .
  • Run the script with input and output paths:
    • python3 .github/skills/markdown-to-pdf/scripts/md_to_pdf.py input.md output.pdf
  • Keep output simple and close to default Markdown rendering.
  • 当用户要求将Markdown文件转换为PDF时使用此技能。
  • 使用脚本.github/skills/markdown-to-pdf/scripts/md_to_pdf.py进行转换。
  • 脚本中默认正文字号为11pt;如有需要可调整CSS。
  • 在安装依赖前,询问是否需要配置代理,若需要则先配置代理再安装依赖。
  • 若依赖缺失则进行安装:
    python3 -m pip install markdown weasyprint
  • 使用输入和输出路径运行脚本:
    • python3 .github/skills/markdown-to-pdf/scripts/md_to_pdf.py input.md output.pdf
  • 保持输出简洁,贴近默认Markdown渲染效果。