pdf-creator: 自动 DYLD_LIBRARY_PATH + 列表渲染修复 + CSS 改进

- macOS ARM Homebrew 库路径自动检测(不再需要手动 export)
- 添加 markdown 预处理器:确保列表前有空行,防止解析为段落文本
- CSS word-break: break-all → overflow-wrap: break-word(中英混排友好)
- batch_convert.py: 修复跨目录运行时的 import 路径
- SKILL.md: 移除手动环境变量步骤

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
daymade
2026-03-03 00:26:32 +08:00
parent 4f07976825
commit acde07ef09
3 changed files with 36 additions and 12 deletions

View File

@@ -12,6 +12,7 @@ Create professional PDF documents from markdown with proper Chinese font support
Convert a single markdown file:
```bash
cd ~/workspace/claude-code-skills/pdf-creator
uv run --with weasyprint --with markdown scripts/md_to_pdf.py input.md output.pdf
```
@@ -21,14 +22,7 @@ Batch convert multiple files:
uv run --with weasyprint --with markdown scripts/batch_convert.py *.md --output-dir ./pdfs
```
## macOS Environment Setup
If encountering library errors, set these environment variables first:
```bash
export DYLD_LIBRARY_PATH="/opt/homebrew/lib:$DYLD_LIBRARY_PATH"
export PKG_CONFIG_PATH="/opt/homebrew/lib/pkgconfig:$PKG_CONFIG_PATH"
```
macOS ARM (Homebrew) 的 `DYLD_LIBRARY_PATH` 会自动检测配置,无需手动设置。
## Font Configuration