Markdown Pdf Skillのロゴ

Markdown Pdf Skill

コミュニティ
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.

概要

公開者GanymedeNil
リポジトリpoxiaoxing-skills
スキル名markdown-pdf-skill
スター
75
フォーク
7
同梱ファイル
21
ライセンスApache-2.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 21個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    GanymedeNilがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Markdown Pdf Skill」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/GanymedeNil/poxiaoxing-skills/tree/main/markdown-pdf-skill
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでMarkdown Pdf Skillを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にMarkdown Pdf Skillを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Markdown Pdf Skillは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

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.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「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.

TypingMindでMarkdown Pdf Skillを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Markdown Pdf Skillはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにMarkdown Pdf Skillをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/GanymedeNil/poxiaoxing-skills/tree/main/markdown-pdf-skillを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Markdown Pdf Skillを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Markdown Pdf Skillで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもMarkdown Pdf Skillを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Markdown Pdf Skill」は無料ですか?

はい。GanymedeNilがApache-2.0ライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇