Index of every page on this site: llms.txt
All skills
staskh avatar

/markdown-to-pdf

@b025c28
by staskhstaskh/trading_skills417 stars
89
Run it yourself

Convert a markdown file to PDF using mistune + reportlab. Use when the user wants to convert a .md file to PDF, or when another skill needs to produce a PDF from markdown output.

Use this Skill: https://skilld.dev/gh/staskh/trading_skills/markdown-to-pdf

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈49 tokens for metadata: the name and description. ≈442 when used: this file.

Description uses 2.5% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈196 characters, or 2.5%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Markdown to PDF Converter

Converts a markdown file to a professionally formatted PDF. Pure Python — no system tools required.

Dependencies

Requires two Python packages (already in pyproject.toml):

mistune>=3.2
reportlab>=4.0

Install with: uv sync (or pip install mistune reportlab)

Instructions

uv run python .claude/skills/markdown-to-pdf/scripts/markdown_to_pdf.py <input.md> [output.pdf]
  • input.md — path to the markdown file (required)
  • output.pdf — output path (optional; defaults to same directory and basename as input)

Output

The script returns JSON with:

  • success — true or false
  • input — resolved absolute path of the input file
  • output — resolved absolute path of the generated PDF
  • error — error message if success is false
  • generated_at — NY timezone timestamp
  • data_delay — always "n/a" (the converter reads no market data; the report states its own delay)

After conversion, tell the user the output PDF path.

Examples

# Convert sandbox/report.md → sandbox/report.pdf (default output)
uv run python .claude/skills/markdown-to-pdf/scripts/markdown_to_pdf.py sandbox/report.md

# Explicit output path
uv run python .claude/skills/markdown-to-pdf/scripts/markdown_to_pdf.py sandbox/report.md sandbox/AAPL_Report_2026-05-20_1430.pdf

Supported Markdown

  • Headings (H1–H3)
  • Paragraphs, bold, italic
  • Tables (pipe syntax)
  • Fenced code blocks
  • Unordered and ordered lists
  • Images: ![alt](path) with a local JPG or PNG, relative to the markdown file or absolute. Each is scaled down to fit the page width and three quarters of its height, keeping its aspect ratio. A missing file or a remote URL shows [image: alt] instead.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts4d3 checks · Risk SAFE
  • Gen Agent Trust Hub4d

    The skill is a utility for converting Markdown documents into PDF files. It uses established Python libraries for parsing and rendering, performs all operations locally, and includes logic to prevent remote image fetching, which mitigates SSRF risks.

  • Socket4d

    No alerts

  • Snyk4d

    Risk: LOW · No issues

Signed by skilld at b025c28. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 6 days ago.

Activeupdated last week
user_invocable
true
dependencies
[
  "trading-skills"
]
Other metadata
arguments
[
  {
    "name": "file",
    "description": "Path to the input markdown file",
    "required": true
  },
  {
    "name": "output",
    "description": "Output PDF path. Defaults to same directory and basename as the input file.",
    "required": false
  }
]

README badge

README badge for staskh/trading_skills/markdown-to-pdf