Token导航 LogoToken导航TokenDH.com
前端设计敏感数据github未标认证来源可访问许可证需确认审计通过

md-to-pdfMD TO PDF 开发

Agent Skill

md-to-pdf 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

890

周安装

36

GitHub Stars

218

下载量

279
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:md-to-pdf(MD TO PDF 开发)
来源仓库:https://github.com/mathews-tom/praxis-skills
仓库路径:skills/md-to-pdf
安装命令:
npx skills add https://github.com/mathews-tom/praxis-skills --skill md-to-pdf
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/mathews-tom/praxis-skills --skill md-to-pdf

简介

用于处理 GitHub 仓库、Issue 和 Pull Request 协作信息。

  • 适合围绕代码变更或仓库状态进行整理分析。md-to-pdf 属于前端设计类 Skill,可作为该场景下的辅助能力补充。
  • 通过 GitHub 安装,建议核验权限范围和命令执行风险。
  • 使用前应确认维护状态及是否会触发网络请求。
  • 可结合原始 README 了解具体操作流程。

SKILL.md

Markdown to PDF Converter

Converts Markdown files to professionally styled PDFs with full rendering of Mermaid diagrams, LaTeX math (via KaTeX), tables, syntax-highlighted code blocks, and all standard Markdown features.

Architecture

Input .md file
     │
     ├─ Step 1: Extract ```mermaid blocks → render to SVG via mmdc (Mermaid CLI + Puppeteer)
     │          Replace mermaid code blocks with inline <svg> in the markdown source
     │
     ├─ Step 2: pandoc converts modified markdown → standalone HTML5
     │          (--katex flag preserves raw LaTeX in <span class="math ..."> elements)
     │
     ├─ Step 3: Node.js KaTeX server-side rendering
     │          Replaces math spans with fully rendered KaTeX HTML (no client-side JS needed)
     │
     ├─ Step 4: CSS injection
     │          KaTeX stylesheet (with local font paths) + professional document styles + optional custom CSS
     │
     └─ Step 5: Playwright (headless Chromium) prints final HTML → PDF
                 ↓
           Output .pdf file

Supported Features

FeatureRendering EngineNotes
Mermaid diagramsmmdc (mermaid-cli) via Puppeteerflowchart, sequence, class, state, ER, gantt, pie, git, mindmap, etc.
LaTeX math (inline)KaTeX server-side$E=mc^2$ syntax
LaTeX math (display)KaTeX server-side$$\int f(x) dx$$ syntax
Tablespandoc + CSSFull GFM pipe-table support with professional styling
Code blockspandoc + CSSSyntax highlighting via pandoc, monospace styling
Imagespandoc + PlaywrightLocal file:// and remote https:// images
LinkspandocRendered as styled text
Lists / blockquotespandocOrdered, unordered, nested, blockquotes
YAML frontmatterpandoctitle used as PDF title metadata
Footnotespandoc + CSS[^1] syntax, rendered at page bottom
Definition listspandoc + CSSTerm / definition pairs
Strikethroughpandoc~~deleted~~ syntax
Horizontal rulespandoc + CSS--- rendered as styled separators

Prerequisites

Run the setup checker before first use:

bash <SKILL_DIR>/scripts/setup.sh

This validates that all required tools are present and working. The standard Claude computer-use environment has everything pre-installed. For other environments, the required stack is:

DependencyPurposeInstall
pandocMarkdown → HTMLapt install pandoc
mmdc (@mermaid-js/mermaid-cli)Mermaid → SVGnpm install -g @mermaid-js/mermaid-cli
katex (npm)LaTeX → HTMLnpm install -g katex
playwright (Python)HTML → PDFpip install playwright && playwright install chromium
Chrome/ChromiumBrowser engineInstalled by Playwright or Puppeteer

Usage

Basic

python3 <SKILL_DIR>/scripts/md_to_pdf.py <input.md> <output.pdf>

Full Options

python3 <SKILL_DIR>/scripts/md_to_pdf.py <input.md> <output.pdf> [OPTIONS]
ParameterDefaultDescription
input*(required)*Path to input Markdown file
output*(required)*Path to output PDF file
--formatA4Page size: A4, Letter, Legal, A3
--margin0.75inMargins — single value (uniform) or top,right,bottom,left
--no-mermaidfalseSkip Mermaid rendering (keeps raw code blocks)
--no-mathfalseSkip KaTeX math rendering
--css*(none)*Path to additional custom CSS file to layer on top
--landscapefalseLandscape orientation
--header-footerfalseShow page numbers in footer (page / total)

Examples

# Standard A4 conversion
python3 scripts/md_to_pdf.py report.md report.pdf

# US Letter, landscape, with page numbers
python3 scripts/md_to_pdf.py report.md report.pdf --format Letter --landscape --header-footer

# Custom margins and extra CSS
python3 scripts/md_to_pdf.py report.md report.pdf --margin "1in,0.75in,1in,0.75in" --css brand.css

# Plain mode (skip Mermaid + math for speed)
python3 scripts/md_to_pdf.py report.md report.pdf --no-mermaid --no-math

Workflow for Claude

When a user asks to convert Markdown to PDF:

  1. Determine the input file path (uploaded file or user-specified path)
  2. Run setup check if this is the first use in the session: bash <SKILL_DIR>/scripts/setup.sh
  3. Execute conversion: python3 <SKILL_DIR>/scripts/md_to_pdf.py /path/to/input.md /path/to/output.pdf [OPTIONS]
  4. Present the output file to the user

Handling Failures

SymptomLikely CauseFix
"mmdc FAILED" in Mermaid stepInvalid Mermaid syntaxCheck diagram syntax; mmdc stderr has the parse error
Raw LaTeX visible in PDFKaTeX couldn't parse expressionCheck LaTeX syntax; KaTeX falls back gracefully
"No Chrome binary found"Puppeteer/Playwright Chromium missingRun playwright install chromium
Blank/missing diagramsSVG too large or complexTry --no-mermaid and render diagrams separately

Customization

Custom CSS

Pass --css path/to/custom.css to inject styles after the defaults. Your rules take precedence.

Example — dark theme override:

body {
  background: #1a1a2e;
  color: #e0e0e0;
}
h1,
h2,
h3 {
  color: #e0e0e0;
  border-color: #444;
}
table th {
  background: #2a2a4a;
}
pre {
  background: #0d0d1a;
  border-color: #333;
}

Mermaid Theming

Set the MERMAID_CONFIG environment variable to a JSON config file:

MERMAID_CONFIG=/path/to/.mermaidrc python3 scripts/md_to_pdf.py input.md output.pdf

Example .mermaidrc:

{
  "theme": "neutral",
  "themeVariables": {
    "primaryColor": "#e1f5fe",
    "lineColor": "#333"
  }
}

Limitations

  • Mermaid diagram rendering requires either network access for CDN-based mmdc or a local @mermaid-js/mermaid-cli install. Offline environments must use --no-mermaid and render diagrams separately.
  • Large documents (100+ pages or many high-resolution images) may hit Playwright's memory limits. Split into multiple input files and merge the resulting PDFs.
  • Custom CSS may not render identically across PDF viewers — layout is determined by Chromium at render time; Acrobat Reader, Preview, and browsers can display the same PDF differently.
  • Page breaks require explicit CSS markers (page-break-before: always or break-before: page) or manual <div style="page-break-before: always"> in the source. Pandoc does not infer page breaks from heading structure.
  • KaTeX coverage is broad but not complete — obscure LaTeX macros or packages not in KaTeX's supported set will fail to render and fall back to raw LaTeX.

File Structure

md-to-pdf/
├── SKILL.md                    # This file — skill documentation
├── LICENSE.txt                 # MIT license
├── README.md                   # Distribution / standalone usage docs
├── scripts/
│   ├── md_to_pdf.py            # Main conversion pipeline (Python)
│   ├── katex_render.js         # Server-side KaTeX math renderer (Node.js)
│   └── setup.sh                # Dependency checker / installer
└── tests/
    └── test_document.md        # Comprehensive test covering all features

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude

33.27%
按下载量换算93

Codex

32.94%
按下载量换算92

Cursor

18.1%
按下载量换算50

Gemini CLI

9.23%
按下载量换算26

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills