content-to-pdf
Skill4 starsChanged 8 months agoMITView on GitHub
Use when the user wants to convert Markdown or structured written content into a polished PDF with good typography, cover metadata, optional table of contents, and print-ready layout. Trigger on requests like "转成 PDF", "排版成 PDF", "导出 PDF", "做成报告 PDF", "把内容排好版", or when the main need is formatting and exporting content rather than writing the content itself.
In this repository5 other files it gives its agents.
- longform-html-infographicSkill
- new-imagegenSkill
- ppt-designSkill
- technical-book-writerSkill
- xiaohongshu-tuwenSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 10 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use this skill for:
- Distinctive: line 24
Do not use this skill when the main problem is writing the manuscript itself.
- Distinctive: line 30
Prefer Markdown with YAML frontmatter.
- Distinctive: line 47
Default to one of these generic document modes:
- Distinctive: line 53
If the user does not specify, infer from the content and pick the most natural one.
- Distinctive: line 65
Use clear heading levels instead of overdesigning.
- Distinctive: line 73
keep headings from getting stranded at the page bottom,
- Distinctive: line 76
keep backgrounds subtle enough for print.
- Distinctive: line 101
Use normal Markdown for paragraphs, lists, tables, blockquotes, and code.
- Distinctive: line 102
Use raw HTML only for special layout needs.
- Very specific: line 103
Use <div class="page-break"></div> when a forced page break is necessary.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Content To PDF
Overview
This skill turns general written content into polished PDF documents. It is designed for Markdown-first workflows where the user already has content, notes, an article, a report, or a guide and wants a reliable path to clean layout, stable hierarchy, and printable output.
Best-Fit Use Cases
Use this skill for:
- articles,
- reports,
- briefs,
- proposals,
- internal guides,
- lightweight manuals,
- content packages that need PDF delivery.
Do not use this skill when the main problem is writing the manuscript itself. In that case, use a writing skill first, then use this one for layout and export.
Workflow
1. Normalize The Source
Prefer Markdown with YAML frontmatter.
Useful frontmatter fields:
titlesubtitlesummaryauthordatekeywordsdocument_typeversiontoctheme
2. Choose The Output Mode
Default to one of these generic document modes:
article: clean reading flow, lighter metadata.report: stronger structure, clearer metadata blocks.guide: slightly more instructional and section-led.
If the user does not specify, infer from the content and pick the most natural one.
3. Keep The Structure Visible
The PDF should make hierarchy obvious:
- title and subtitle,
- optional summary,
- optional table of contents,
- section headings,
- callouts, quotes, tables, and code blocks when present.
Use clear heading levels instead of overdesigning.
4. Preserve Readability In Print
When exporting:
- use stable margins,
- avoid cramped typography,
- keep headings from getting stranded at the page bottom,
- preserve table readability,
- preserve code block contrast,
- keep backgrounds subtle enough for print.
5. Use The Bundled Exporter
This skill includes a Playwright-based exporter for Markdown to PDF.
- Template: template.html
- Styles: styles.css
- Formatting reference: format-guide.md
- Presets reference: layout-presets.md
- Example source: sample-content.md
- Exporter: export_pdf.mjs
Example:
node content-to-pdf/scripts/export_pdf.mjs \
--input content-to-pdf/examples/sample-content.md \
--output output/pdf/content-to-pdf-sample.pdfMarkup Conventions
- Frontmatter controls cover metadata and options.
# Headingand## Headingare used to build the optional TOC.- Use normal Markdown for paragraphs, lists, tables, blockquotes, and code.
- Use raw HTML only for special layout needs.
- Use
<div class="page-break"></div>when a forced page break is necessary.
Quality Bar
Before delivering, verify:
- hierarchy is easy to scan,
- the cover looks intentional when metadata exists,
- the body feels like a designed document rather than a browser printout,
- tables and code blocks are readable,
- page breaks do not produce obvious visual defects.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

