Agent skill

Huashu Md To PDF

by alchaincyf in alchaincyf/huashu-skills

将 Markdown 文档转换为专业的 PDF 白皮书,采用苹果设计风格. An agent skill from alchaincyf/huashu-skills.

MITAuto-check passedDocuments & Office

Install Huashu Md To PDF

skills CLI
$ npx skills add alchaincyf/huashu-skills --skill huashu-md-to-pdf -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install alchaincyf/huashu-skills huashu-md-to-pdf --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/alchaincyf/huashu-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/huashu-md-to-pdf .claude/skills/huashu-md-to-pdf && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
huashu-md-to-pdf
GitHub stars
1.7k
Token cost
~824 tokens
SKILL.md length
218 words
Files
4 (incl. scripts)
Skills in repo
21
Repo updated
First seen
Licence
MIT

At a glance

将 Markdown 文档转换为专业的 PDF 白皮书,采用苹果设计风格. An agent skill from alchaincyf/huashu-skills.

  • Works in 4 steps: 专业排版:书籍级排版质量,自动处理分页、孤行寡行 → 苹果设计:SF 字体系统、现代简洁风格、专业配色 → 完整目录:自动提取章节结构,双列布局,可点击跳转 → …
  • Tasks that involve PDF
  • SKILL.md covers 核心功能, 使用方法, 设计特点 and 配置选项, plus 6 more sections
  • Runs Python scripts from its folder; calls python, pip3 and brew

What it does

Huashu Md To PDF is an agent skill from alchaincyf/huashu-skills. 将 Markdown 文档转换为专业的 PDF 白皮书,采用苹果设计风格。 支持完整的 Markdown 语法(代码块、表格、引用、列表等)。 自动生成封面、目录、页眉页脚。 使用场景:技术文档、白皮书、教程、报告等需要专业排版的 Markdown 文档。

Its SKILL.md is about 820 tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including scripts (for example `EXAMPLES.md`, `README.md` and `scripts/convert.py`).

It sits in Documents & Office, covering PDF and Markdown. It works with macOS. The repository describes itself as: 花叔全部开源 Agent Skills 总目录:16 旗舰 + 14 人物视角 + 22 内置共 52 个 skill,分层分类 + AI Agent 安装协议 + 机器可读 skills.json + 更新检查机制. The licence is MIT.

When your agent uses it

  • Tasks that involve PDF
  • Tasks that involve Markdown

Example prompts

  • “/huashu-md-to-pdf”

Requirements

  • Python 3

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. 专业排版:书籍级排版质量,自动处理分页、孤行寡行
  2. 苹果设计:SF 字体系统、现代简洁风格、专业配色
  3. 完整目录:自动提取章节结构,双列布局,可点击跳转
  4. Markdown 完美支持:代码块、表格、引用、列表等全部正确渲染

What it can do on your machine

Read from SKILL.md and the folder at commit 2efea35. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python
    • pip3
    • brew

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pip3, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Huashu Md To PDF loads about 824 tokens when it runs. Until then it costs about 36 tokens; SKILL.md has 218 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~36
When it runs · the whole SKILL.md, loaded when a task matches
~824

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from alchaincyf/huashu-skills at commit 2efea35, republished under its MIT licence (© alchaincyf). 218 words, ~824 tokens.

Download SKILL.mdSave it as .claude/skills/huashu-md-to-pdf/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
huashu-md-to-pdf
description
将 Markdown 文档转换为专业的 PDF 白皮书,采用苹果设计风格。 支持完整的 Markdown 语法(代码块、表格、引用、列表等)。 自动生成封面、目录、页眉页脚。 使用场景:技术文档、白皮书、教程、报告等需要专业排版的 Markdown 文档。

Markdown to PDF Skill

将 Markdown 文档转换为专业的苹果设计风格 PDF 白皮书。

核心功能

  1. 专业排版:书籍级排版质量,自动处理分页、孤行寡行
  2. 苹果设计:SF 字体系统、现代简洁风格、专业配色
  3. 完整目录:自动提取章节结构,双列布局,可点击跳转
  4. Markdown 完美支持:代码块、表格、引用、列表等全部正确渲染

使用方法

基础用法
bash
# 转换单个文件
python scripts/convert.py input.md

# 指定输出文件名
python scripts/convert.py input.md -o "我的白皮书.pdf"

# 自定义标题和作者
python scripts/convert.py input.md --title "技术白皮书" --author "花叔"
图片路径

Markdown 里的相对路径图片,是相对 md 文件自身所在目录解析的,目录名和文件名带中文都可以:

markdown
![示意图](图片/架构图.png)     ← 和 md 文件同级的「图片」目录
![示意图](./assets/arch.png)

找不到的图片会在转换时打印警告并列出路径。以前这种情况是静默跳过的,PDF 照样生成、只是没有图。

已知未解决:某些环境下 macOS「预览」打开是乱码

有用户报告生成的 PDF 在 macOS「预览」里是乱码,浏览器打开正常。这个问题还没有解决办法,原因也还没定位——在一台用 Arial Unicode MS 渲染中文的机器上复现不出来,而报告者的字体环境和 weasyprint 版本都不清楚。

不要试图用 weasyprint 的 full_fonts=True 绕过它。 实测:macOS 上的中文字体(PingFang.ttc、Songti.ttc、Hiragino Sans GB.ttc)都是 TrueType Collection,full_fonts=True 会把整个 collection 的原始字节塞进 PDF 的 /FontFile2(magic 是 ttcf 而不是合法的 \x00\x01\x00\x00),结果是文件暴涨到几十 MB,而且照样乱码——实测一段中文从 10 KB 变成 43 MB,渲染出来是「Oě 据⊤」。它让问题更糟,不是逃生出口。

碰到乱码时可以先试:升级 weasyprint、或在 CSS 里换一个非 collection 的字体。

Markdown 文档要求

你的 Markdown 文档应该遵循以下结构:

markdown
# 文档标题

## 1. 第一章
### 1.1 第一节
### 1.2 第二节

## 2. 第二章
### 2.1 第一节

关键规则:

  • 主章节:## 1. 标题(数字 + 点 + 空格 + 标题)
  • 子章节:### 1.1 标题(数字.数字 + 空格 + 标题)
  • 这样才能正确提取目录

设计特点

封面设计
  • 淡灰色渐变背景
  • 大标题:64pt,简洁现代
  • 副标题和元信息
目录设计
  • 双列布局,单页展示
  • 主章节粗体,子章节缩进
  • 可点击跳转到对应章节
正文排版
  • SF 字体系列(苹果设计语言)
  • 行高 1.7,舒适阅读
  • 章节自动分页
  • 孤行寡行控制
代码块
  • 浅灰背景 + 细边框
  • 圆角 8px
  • SF Mono 等宽字体
  • 自动避免分页
表格
  • 清晰网格线
  • 浅灰表头
  • 自动保留表头(长表格分页时)

配置选项

如果需要自定义样式,可以修改 scripts/convert.py 中的 CSS 变量:

python
# 主色调
PRIMARY_COLOR = '#06c'      # 苹果蓝
TEXT_COLOR = '#1d1d1f'      # 主文本黑色
GRAY_COLOR = '#86868b'      # 浅灰色

# 字体大小
COVER_TITLE_SIZE = '64pt'
H2_SIZE = '22pt'
H3_SIZE = '17pt'
BODY_SIZE = '11pt'

常见问题

Q: 目录为什么是空的?

A: 确保你的 Markdown 使用了正确的章节格式:

  • ## 1. 标题 而不是 ## 标题
  • ### 1.1 标题 而不是 ### 标题
Q: 代码块显示不正确?

A: 确保使用三个反引号包裹:

markdown
```python
def hello():
    print("Hello")
```
Q: 表格格式乱了?

A: 使用标准的 Markdown 表格语法:

markdown
| 列1 | 列2 |
|-----|-----|
| 值1 | 值2 |
Q: 如何修改字体?

A: 编辑 scripts/convert.py 中的 CSS,修改 font-family 属性。

Q: 生成的 PDF 太大?

A: 检查是否有大量图片,考虑压缩图片或使用外链。

依赖安装

首次使用需要安装 Python 依赖:

bash
pip3 install markdown2 weasyprint

如果遇到 WeasyPrint 安装问题(macOS):

bash
brew install pango
pip3 install weasyprint

示例

生成技术文档
bash
python scripts/convert.py tech-guide.md -o "技术指南.pdf"
生成白皮书
bash
python scripts/convert.py whitepaper.md --title "产品白皮书" --author "团队"

脚本说明

  • scripts/convert.py - 主转换脚本
  • scripts/styles.css - CSS 样式定义(已嵌入脚本)
  • templates/cover.html - 封面模板(已嵌入脚本)

技术实现

本 Skill 使用:

  • markdown2:Markdown 解析(支持扩展语法)
  • WeasyPrint:HTML to PDF 转换(支持 CSS3)
  • 苹果设计系统:SF 字体、专业配色、现代排版

更新日志

v1.0 (2025-12-24)
  • 初始版本
  • 支持完整 Markdown 语法
  • 苹果设计风格
  • 自动目录生成
  • 书籍级排版质量

花叔出品 | AI Native Coder · 独立开发者 公众号「花叔」| 30万+粉丝 | AI工具与效率提升 代表作:小猫补光灯(AppStore付费榜Top1)·《一本书玩转DeepSeek》

© alchaincyf, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (scripts) in huashu-md-to-pdf of alchaincyf/huashu-skills.

  • SKILL.md
  • EXAMPLES.md
  • README.md
  • scripts/convert.py

Open the folder on GitHubat commit 2efea35

Compare with similar skills

Huashu Md To PDF next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Huashu Md To PDF compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Huashu Md To PDF this skillalchaincyf/huashu-skills1.7k—~824Automated safety check: PassMIT
MarkitdownImCa0/just-laws78114 repos~3.2kAutomated safety check: NotesMIT
Gzh Designisjiamu/gzh-design-skill4k—~2.2kAutomated safety check: PassAGPL-3.0
Bookforge Korean Ebook PDF Makergongnyang/bookforge3161 repos~1.7kAutomated safety check: PassMIT
Huashu Markdown Publishing Pipelinealchaincyf/huashu-md-html910—~4.8kAutomated safety check: PassMIT
Gzh DesignZJU-REAL/Easel3.4k—~2.1kAutomated safety check: PassAGPL-3.0

Similar skills

  • Markitdown

    ImCa0/just-laws

    Convert files and office documents to Markdown. An agent skill from ImCa0/just-laws.

    781 GitHub starsUsed in 14 repos~3.2k tokens
    Documents & OfficeAuto-check: notes
  • Gzh Design

    isjiamu/gzh-design-skill

    微信公众号文章排版引擎,将 Markdown 转换为可直接粘贴到公众号编辑器的 HTML。主题风格从 references/theme-index.md 注册的自定义主题库中选取,自动章节编号、关键词下划线标记、引言卡片、目录导航、代码块、图片/GIF、作者签名。支持 Markdown / Word(.docx) / PDF / 纯文本输入(非 Markdown…

    4k GitHub stars~2.2k tokensUpdated 2 days ago
    Documents & OfficeAuto-check passed
  • Produces book-style Korean ebook PDFs from a topic or finished manuscript, with six design styles, real book parts and quality-check gates before output.

    316 GitHub starsUsed in 1 repo~1.7k tokens
    Documents & OfficeAuto-check passed
  • Huashu Markdown Publishing Pipeline

    alchaincyf/huashu-md-html

    Converts files and web pages into clean Markdown, then turns Markdown into polished HTML, Word, PDF and EPUB using four templates.

    910 GitHub stars~4.8k tokensUpdated 1 mo ago
    Documents & OfficeAuto-check passed
  • Gzh Design

    ZJU-REAL/Easel

    微信公众号文章排版引擎:把 Markdown / Word(.docx) / PDF / 纯文本转成可直接粘贴进公众号编辑器的 HTML,自动章节编号、关键词标记、引言卡、目录、代码块、图片/GIF、作者签名;主题从 references/theme-index.md…

    3.4k GitHub stars~2.1k tokensUpdated today
    Documents & OfficeAuto-check passed
  • 从论文 PDF 文件或论文 PDF URL 生成通俗易懂、图文并茂、带批判性评估的中文 Markdown 解读,并保存到当前项目的 markdown 目录。Use when the user asks to interpret,精读,解读,summarize,explain,analyze, or write an article from an academic paper PDF…

    8.6k GitHub stars~1.5k tokensUpdated 2 days ago
    Documents & OfficeAuto-check passed

More from alchaincyf/huashu-skills

All 21 skills in this repo
  • Huashu Agent Swarm

    alchaincyf/huashu-skills

    多Agent蜂群并行协作,纯git自组织,适合大型项目开发。当用户提到"蜂群模式"、"多agent"、"并行开发"、"agent swarm"时使用。

    1.7k GitHub stars~576 tokensUpdated 18 days ago
    Auto-check passed
  • Huashu Data Pro

    alchaincyf/huashu-skills

    数据分析与办公提效全能助手。覆盖数据处理、分析洞察、报告撰写、PPT制作、数据可视化的端到端工作流. An agent skill from alchaincyf/huashu-skills.

    1.7k GitHub stars~928 tokensUpdated 18 days ago
    Auto-check passed
  • Huashu Douyin Script

    alchaincyf/huashu-skills

    抖音爆款脚本创作工作流。从竞品视频拆解到脚本生成的完整流程:下载抖音视频→Gemini视频分析→爆款公式提炼→脚本+分镜生成→AI味审校。

    1.7k GitHub stars~1.7k tokensUpdated 18 days ago
    Auto-check passed
  • Huashu Wechat Image

    alchaincyf/huashu-skills

    为微信公众号文章生成高质量配图。支持封面图(2.35:1)、正文插图(16:9/4:3)、信息图。提供两条路径:AI生成(视觉创意型)和HTML渲染(文字精确型)。当用户提到"公众号配图"、"公众号封面"、"文章配图"、"正文插图"、"公众号图片"时使用此技能。

    1.7k GitHub stars~2.4k tokensUpdated 18 days ago
    Auto-check: notes
  • Huashu Xhs Image

    alchaincyf/huashu-skills

    为小红书笔记生成高质量配图。默认AI生成(Gemini),仅精确数据表格用HTML兜底。当用户提到"小红书配图"、"小红书封面"、"小红书图片"、"做张小红书图"、"笔记配图"时使用此技能。

    1.7k GitHub stars~1.5k tokensUpdated 18 days ago
    Auto-check: notes
  • Huashu Slides

    alchaincyf/huashu-skills

    从内容到成品PPTX的端到端演示文稿制作,含AI插画生成和18种设计风格。当用户提到"做PPT"、"做幻灯片"、"演示文稿"、"Keynote"、"slides"时使用。

    1.7k GitHub stars~7.2k tokensUpdated 18 days ago
    Auto-check: notes

Works with

Questions about Huashu Md To PDF

What does Huashu Md To PDF do?

将 Markdown 文档转换为专业的 PDF 白皮书,采用苹果设计风格. An agent skill from alchaincyf/huashu-skills. Huashu Md To PDF is an agent skill from alchaincyf/huashu-skills.

When should I use Huashu Md To PDF?

Huashu Md To PDF fits situations like: tasks that involve PDF; tasks that involve Markdown.

How do I install Huashu Md To PDF in Claude Code?

Run `npx skills add alchaincyf/huashu-skills --skill huashu-md-to-pdf -a claude-code`. Or copy the skill folder (huashu-md-to-pdf in alchaincyf/huashu-skills) into .claude/skills/huashu-md-to-pdf in your project. Claude Code loads it when a task matches its description.

How do I install Huashu Md To PDF in Codex?

Run `npx skills add alchaincyf/huashu-skills --skill huashu-md-to-pdf -a codex`. Or copy the skill folder (huashu-md-to-pdf in alchaincyf/huashu-skills) into .agents/skills/huashu-md-to-pdf in your project. Codex loads it when a task matches its description.

Can I use Huashu Md To PDF in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add alchaincyf/huashu-skills --skill huashu-md-to-pdf -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/huashu-md-to-pdf, .gemini/skills/huashu-md-to-pdf, .github/skills/huashu-md-to-pdf and .opencode/skills/huashu-md-to-pdf in your project.

What does Huashu Md To PDF need to run?

Going by SKILL.md and its folder, Huashu Md To PDF needs Python for the scripts in its folder and the command-line tools its instructions call (python, pip3 and brew). Our summary lists: Python 3.

Does Huashu Md To PDF access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Huashu Md To PDF safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Huashu Md To PDF use?

Huashu Md To PDF is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Huashu Md To PDF use?

About 824 tokens (SKILL.md is roughly 3.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Huashu Md To PDF?

Skills that share tags, products or a category with Huashu Md To PDF: Markitdown (ImCa0/just-laws, 781 stars), Gzh Design (isjiamu/gzh-design-skill, 4k stars), Bookforge Korean Ebook PDF Maker (gongnyang/bookforge, 316 stars) and Huashu Markdown Publishing Pipeline (alchaincyf/huashu-md-html, 910 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Huashu Md To PDF?

alchaincyf (a GitHub user) maintains it in alchaincyf/huashu-skills, which has 1,695 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on September 22, 2026.

Source: alchaincyf/huashu-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.