markdown-to-pdf SKILL.md skillA
markdown-to-pdf from black-yt/skills is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add black-yt/skills/markdown-to-pdf@git:20260605.e763408Pins git:20260605.e763408 in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- black-yt/skills
- Path
markdown-to-pdf/SKILL.md- Versions recorded
- 3
- Latest version
- git:20260605.e763408, committed Jun 5, 2026
- First version recorded
- May 9, 2026
- Size
- 3,382 bytes
- Repository stars
- 16
- License
- none declared
当需要用 Python 将 Markdown 转为 PDF,并保留表格、代码块、图片路径和基础 CSS 样式时使用。.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# Markdown 转 PDF
## 使用场景
将 Markdown 文件转为 PDF。脚本会先用 `markdown2` 转 HTML,再用 `WeasyPrint` 输出 PDF。
## 依赖安装
```bash
pip install markdown2 weasyprint
```
`WeasyPrint` 可能还需要系统图形/字体相关依赖。如果运行时报 Cairo、Pango、fontconfig 等错误,按 WeasyPrint 官方文档补齐系统依赖。
检查:
```bash
python -c "import markdown2; from weasyprint import HTML; print('md2pdf deps ok')"
```
## 源码追溯
- Markdown 转 HTML 和 HTML 转 PDF 的行为分别由 `markdown2` 和 `WeasyPrint` 决定;表格、代码块、图片路径、字体或 CSS 问题不确定时,先查看当前安装版本源码。
- `module.__file__` 可定位安装路径。
- `inspect.getsource(...)` 可查看关键函数或类。
- 源码只用于阅读和定位问题,不要改源码,不要直接改 `site-packages`;优先调整本仓库脚本的参数、CSS 或 wrapper。
```bash
python - <<'PY'
import inspect
import markdown2
import weasyprint
from weasyprint import HTML
print("markdown2:", getattr(markdown2, "__version__", "unknown"), markdown2.__file__)
print("weasyprint:", getattr(weasyprint, "__version__", "unknown"), weasyprint.__file__)
print(inspect.getsource(markdown2.markdown))
print(inspect.getsource(HTML.write_pdf))
PY
```
## 脚本
优先使用 bundled script:
```text
scripts/md_to_pdf.py
```
## 命令行用法
基本用法:
```bash
python scripts/md_to_pdf.py input.md output.pdf
```
指定输出目录:
```bash
python scripts/md_to_pdf.py input.md output_dir
```
…Read the whole file at its exact version.
How to install
mdr add black-yt/skills/markdown-to-pdf@sha256:83d42481018b7d31The line at the top of this page pins the label git:20260605.e763408, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_g4h4cq5x2ol7p73w)
4 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 3 versions of this file, between May 9, 2026 and Jun 5, 2026, about one every 14 days.
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20260605.e763408 latest | 2026-06-05 | e763408 | 3,382 B | A | view · diff |
| git:20260509.cdf62b1 | 2026-05-09 | cdf62b1 | 2,536 B | A | view · diff |
| git:20260509.e0ce9ca | 2026-05-09 | e0ce9ca | 2,126 B | A | view |
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (3382 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
black-yt/skills · 16 stars · license none declared · pushed 2026-11-05 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_g4h4cq5x2ol7p73w GET https://markdownregistry.com/api/v1/resolve?ref=black-yt/skills/markdown-to-pdf GET https://markdownregistry.com/api/v1/blob/83d42481018b7d310c0352e99363e81978994c34c61c0b709dc7342bd352044a
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.