Huashu Md To PDF
Turns a Markdown document into a clean A4 PDF white paper with a cover page, a clickable contents page and page numbers.
What it is
A converter for people who write in Markdown, the plain-text format with # headings that many note apps and AI chats use, and need a polished PDF to hand out: a white paper, a guide, a tutorial or a report. The look borrows from Apple's design style, with clean sans-serif type, roomy line spacing, light gray details and one blue accent color. The author is Chinese, so the contents page is headed in Chinese and the document language is set to Chinese, though English text works too.
Instead of having the AI format a document by hand, it runs a bundled Python script built on markdown2, which reads Markdown, and WeasyPrint, which turns styled web pages into PDF. The script uses your first main heading as the cover title, builds a two-column contents page from numbered chapter headings, and starts every chapter on a new page. It tries to keep code blocks, tables, quotes and images from splitting across pages, avoids stranded single lines, and warns you about images it cannot find instead of silently leaving them out.
You get one PDF saved next to your Markdown file, or under a name you choose, with an optional custom title, subtitle and author. The contents page only fills in if chapters are numbered like 1. Introduction and sections like 1.1 Background, so plain headings leave it empty. Emojis are removed, and changing colors or fonts means editing the script. The author also notes an unsolved problem: on some Macs the Preview app shows garbled Chinese text even though browsers display the same PDF correctly.
What it can do
- Builds a cover page from your document's main title, with an optional subtitle and author name.
- Creates a two-column contents page from numbered headings, where each entry links to its chapter.
- Adds a header with the document title and page number to every body page.
- Lays out code blocks, tables, quotes, lists, checklists and strikethrough text cleanly on A4 pages.
- Starts each main chapter on a new page and keeps headings from sitting alone at a page bottom.
- Includes images from your Markdown, found relative to the file's folder, and lists any that are missing.
- Converts every Markdown file in a folder one after another when you ask.
When to use it
- You drafted a product white paper in Markdown and want a PDF with a proper cover and contents page to send to clients.
- Your team's how-to guide lives in a Markdown file and needs to become a printable A4 handbook.
- You asked an AI to write a long research summary in Markdown and want to share it as a tidy PDF rather than a chat transcript.
- You have a folder of tutorial chapters saved as .md files and want each one turned into its own PDF.
How it works
- 1Makes sure Python and the two libraries it relies on, markdown2 and WeasyPrint, are installed, which is a one-time step.
- 2Reads your Markdown file, takes the first main heading as the cover title and collects the numbered chapters and sections for the contents page.
- 3Converts the text into a styled web page using its built-in Apple-style layout, then renders that page to an A4 PDF with WeasyPrint.
- 4Warns about any images it could not find, saves the PDF next to the original file or under your chosen name, and reports the file size.
Try asking
How to install
Install with the skills CLI (recommended)
Works with Claude Code, Codex, Cursor, OpenCode and other agents, and asks which ones to install to. Needs Node.js 22.20+. Add -g to make it available in every project.
npx skills add https://github.com/alchaincyf/huashu-skills/tree/master/huashu-md-to-pdf
pnpm dlx skills add https://github.com/alchaincyf/huashu-skills/tree/master/huashu-md-to-pdf
Install manually
Copies the skill folder into Claude Code's personal skills directory. For claude.ai, zip the huashu-md-to-pdf folder and upload it in the Skills section of Settings.
git clone --depth 1 https://github.com/alchaincyf/huashu-skills.git mkdir -p ~/.claude/skills cp -r huashu-skills/huashu-md-to-pdf ~/.claude/skills/huashu-md-to-pdf
Then just ask in plain language, for example: “Turn whitepaper.md into a PDF white paper.”
More Office & Documents skills
PPT Master
73kTurns documents, topics or slide images into natively editable PowerPoint decks, and can restyle, refill or narrate decks you already have.
Employment Contract Templates
42kDrafts offer letters, employment agreements and employee handbook policies from fill-in templates, ready for a lawyer to review.
Startup Metrics Framework
42kCalculates and benchmarks the startup numbers investors ask about, from CAC, LTV and burn multiple to retention, GMV and sales pipeline.