Markdown Pdf Skill logo

Markdown Pdf Skill

Community
GanymedeNil
markdown-pdf-skill

Convert Markdown into polished, print-ready PDF documents with deliberate typography, automatic or user-selected style templates, reliable local and remote image handling, robust CJK support, page headers and footers, and pagination-aware layout. Use when Codex needs to export, typeset, restyle, or visually QA Markdown as PDF, especially for long documents containing headings, tables, code blocks, images, lists, blockquotes, footnotes, math, or content that must cross pages cleanly.

Overview

PublisherGanymedeNil
Repositorypoxiaoxing-skills
Skill namemarkdown-pdf-skill
Stars
75
Forks
7
Bundled files
21
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 21 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by GanymedeNil on GitHub. Read the source before you install it.

Installation

Install the Markdown Pdf Skill AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/GanymedeNil/poxiaoxing-skills/tree/main/markdown-pdf-skill
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/GanymedeNil/poxiaoxing-skills.git /tmp/poxiaoxing-skills
mkdir -p .claude/skills
cp -r /tmp/poxiaoxing-skills/markdown-pdf-skill .claude/skills/markdown-pdf-skill
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Markdown Pdf Skill in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Markdown Pdf Skill on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Markdown Pdf Skill is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Markdown PDF Skill

Turn Markdown into a professional PDF and prove that the rendered pages are sound. Treat pagination as part of the design, not as a final conversion step.

Workflow

  1. Ask about the table of contents before doing any layout work.

    • Ask the user: 是否需要加入目录?
    • Wait for the answer. Do not infer the choice from document length.
    • Skip the question only when the current request already says to include or omit a table of contents.
    • Pass --toc for yes or --no-toc for no. The exporter rejects an omitted choice.
  2. Inspect the source before exporting.

    • Identify the language, title hierarchy, long tables, long code blocks, local or remote images, raw HTML, footnotes, math, and explicit page-break requests.
    • Preserve the author's words and structure unless the user asks for editorial changes.
    • Read references/markdown-support.md when the document uses unusual Markdown, diagrams, math, raw HTML, or oversized media.
  3. Choose print geometry and style deliberately.

    • Default to A4 portrait for CJK and international documents.
    • Use Letter only for US-facing material.
    • Use landscape for genuinely wide tables; do not shrink normal prose to rescue one table.
    • Honor an explicitly requested theme. Otherwise keep --theme auto and report the selected theme and reason.
    • Run python3 scripts/export_markdown_pdf.py --list-themes or read references/themes.md when the user wants choices.
    • Read references/pagination.md before tuning a long or layout-sensitive document.
  4. Export with the bundled renderer.

    bash
    python3 scripts/export_markdown_pdf.py INPUT.md -o OUTPUT.pdf --toc --theme auto

    Use --remote-images freeze (the default) to download and embed online images. Add --orientation landscape, an explicit --theme, --math, or --css custom.css only when the content requires it. Use <!-- pagebreak --> for an intentional hard break. Use <div class="keep-together" markdown="1">...</div> sparingly for a short block that must remain intact.

  5. Inspect the actual PDF, not only the HTML.

    bash
    python3 scripts/inspect_pdf.py OUTPUT.pdf --output-dir tmp/pdfs/review

    Open the generated contact sheet, then inspect suspicious pages at full resolution. Check every page for clipped content, awkward whitespace, orphaned headings, lonely final lines, table row breaks, repeated table headers, split captions, image scale, code wrapping, page numbering, and CJK glyph fallback.

  6. Iterate until clean.

    • Fix the source structure first, then CSS.
    • Prefer local, targeted classes or page breaks over global font reduction.
    • Re-export and re-run inspection after every meaningful layout change.
    • Deliver only after the latest rendered pages show no visible defects.

Installation

Create an isolated environment and install the pinned capability set when imports are missing:

bash
python3 -m venv .venv
.venv/bin/python -m pip install -r scripts/requirements.txt

The renderer uses Python-Markdown, WeasyPrint, and Matplotlib's vector math renderer. The inspector uses PyMuPDF, pypdf, and Pillow. If WeasyPrint installation fails because native libraries are absent, follow the platform instructions printed by WeasyPrint rather than silently switching renderers; pagination differs across engines.

Rendering Rules

  • Keep headings with at least the next content block.
  • Apply widows and orphans controls to prose and list items.
  • Keep short tables, code blocks, quotes, and figures together; allow oversized blocks to split so they do not overflow or create blank pages.
  • Repeat table headers across pages and never split a table row.
  • Keep captions with their media.
  • Preserve readable type size. Change orientation or restructure an oversized table before reducing body text.
  • Use system CJK font fallbacks and verify every glyph visually.
  • Keep links clickable, footnotes legible, and syntax highlighting printable in grayscale.
  • Avoid a hard page break unless semantic grouping or visual balance clearly benefits.

Inputs and Outputs

  • Accept UTF-8 Markdown and resolve relative images from the Markdown file's directory.
  • Read optional YAML frontmatter keys: title, subtitle, author, date, and lang.
  • Resolve local images from the Markdown directory. Download and embed remote images by default; use live URLs only when the user explicitly accepts non-reproducible output.
  • Preserve raw HTML supported by WeasyPrint. Expect JavaScript-dependent content to require pre-rendering.
  • Write final PDFs to the path requested by the user. Place temporary HTML, page images, and reports under tmp/pdfs/ and remove them after final approval.
  • Keep filenames stable and descriptive.

Manual Controls

  • Insert <!-- pagebreak --> for an explicit new page.
  • Wrap a short unit in <div class="keep-together" markdown="1">...</div> to prohibit an internal break.
  • Wrap content in <div class="avoid-break-before" markdown="1">...</div> to keep it near the preceding block.
  • Add a user stylesheet with --css; keep overrides narrow and document-specific.
  • Save intermediate HTML with --html-output PATH when diagnosing selector or asset problems.

Quality Gate

Require all of the following before delivery:

  • The exporter completes without missing-asset or unsupported-feature warnings.
  • The inspector reports the expected page size, no blank pages, no out-of-bounds text or image blocks, and no heading stranded at a page bottom.
  • Contact-sheet review covers every page.
  • Full-size review covers the first page, final page, every page transition around a table or code block, and every page reported as suspicious.
  • Extracted text is non-empty and major headings appear in the expected order.
  • The final PDF contains no placeholders, debug paths, tool tokens, or accidental intermediate content.

Use references/qa-checklist.md for the final visual pass.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Markdown Pdf Skill AI skill do?

Convert Markdown into polished, print-ready PDF documents with deliberate typography, automatic or user-selected style templates, reliable local and remote image handling, robust CJK support, page headers and footers, and pagination-aware layout. Use when Codex needs to export, typeset, restyle, or visually QA Markdown as PDF, especially for long documents containing headings, tables, code blocks, images, lists, blockquotes, footnotes, math, or content that must cross pages cleanly.

Why use Markdown Pdf Skill on TypingMind?

Because you install it once and use it with any model. Markdown Pdf Skill is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Markdown Pdf Skill in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/GanymedeNil/poxiaoxing-skills/tree/main/markdown-pdf-skill. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Markdown Pdf Skill?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Markdown Pdf Skill?

As many as you like. As long as a model supports skills, you can use Markdown Pdf Skill with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Markdown Pdf Skill AI skill free?

Yes. It is published on GitHub by GanymedeNil under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇