agentleFS
developer0hyedeveloper0hye/marknest/skills/md2pdf/SKILL.md

md2pdf

Skill15 starsChanged 2 months agoMITView on GitHub

Convert Markdown files to professional PDFs using marknest — a Rust-powered CLI that handles single files, entire folders, ZIP archives, and even GitHub repository URLs. Use this skill whenever the user wants to turn .md files into PDFs, generate printable documentation, export markdown as PDF, batch-convert a docs folder, or create styled PDF reports from markdown. Also trigger when the user mentions "markdown to PDF", "md to pdf", "export as PDF", "print markdown", "PDF from README", "convert docs to PDF", or asks to make markdown files look professional/printable. This skill covers theming, table of contents generation, Mermaid diagram rendering, LaTeX math support, and custom styling — so use it even if the user asks for "pretty PDFs", "styled documentation", or "PDF with diagrams and math".

  • Installs packages

5 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions5 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 5

    1. kaiye/skills★ 19same name
    2. enkr1/claude-code-skills★ 1same name
    3. tanpenggood/skills★ 1same name
    4. cy070812/md2pdf-skill★ 0same name
    5. Qubity-dev/claude-skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    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
  1. Distinctive:

    If the markdown contains Mermaid code blocks, enable rendering:

    line 106
  2. Distinctive:

    If the markdown contains LaTeX math expressions:

    line 114
  3. Distinctive:

    Before converting, you can validate markdown files to catch broken links and rendering issues:

    line 147
  4. Distinctive:

    When the user asks to convert markdown to PDF, follow this logic:

    line 170
  5. Very specific:

    If the user has a .marknest.toml config file in their project, marknest will pick it up automatically — no need to pass flags that are …

    line 178

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Marknest: Markdown to PDF Converter

You are helping the user convert Markdown files into professional PDFs using marknest, a fast Rust-powered CLI tool.

Why marknest?

marknest handles everything needed for high-quality PDF output from Markdown: embedded images, Mermaid diagrams, LaTeX math, syntax-highlighted code blocks, table of contents, and multiple built-in themes. It works locally with no cloud dependencies — all rendering assets are vendored. It accepts single files, folders, ZIP archives, and GitHub URLs as input.

Requirements

marknest requires Chromium for PDF rendering (Mermaid diagrams, math, and HTML-to-PDF conversion). Before running any conversion, ensure Chromium is installed:

# Check if Chromium/Chrome is available
npx playwright install chromium

This only needs to be done once. If the user already has Chrome or Chromium installed on their system, marknest will detect and use it automatically.

Installation

Prefer npx (zero-install):

# Option 1: Use npx (no install needed, recommended)
npx marknest convert ...

# Option 2: Install globally via npm
npm install -g marknest

# Option 3: Install via Cargo (if Rust toolchain is available)
cargo install marknest

Core Commands

Single file conversion

npx marknest convert README.md -o README.pdf

Batch conversion (folder)

npx marknest convert ./docs --all --out-dir ./pdf

From GitHub URL

npx marknest convert https://github.com/user/repo/blob/main/docs/guide.md -o guide.pdf

From ZIP archive

npx marknest convert ./docs.zip --all --out-dir ./pdf

Styling & Themes

marknest has four built-in themes. Choose one that fits the user's needs:

ThemeBest for
defaultGeneral purpose, clean look
githubGitHub-flavored markdown appearance
docsTechnical documentation
plainMinimal, no frills
npx marknest convert README.md -o README.pdf --theme github

For custom styling, use --css:

npx marknest convert README.md -o README.pdf --css custom.css

Advanced Features

Table of Contents

npx marknest convert README.md -o README.pdf --toc

Mermaid Diagrams

If the markdown contains Mermaid code blocks, enable rendering:

npx marknest convert README.md -o README.pdf --mermaid auto

LaTeX Math

If the markdown contains LaTeX math expressions:

npx marknest convert README.md -o README.pdf --math auto

Page Layout

# Landscape orientation
npx marknest convert README.md -o README.pdf --landscape

# Custom page size
npx marknest convert README.md -o README.pdf --page-size letter

# Custom margins (pixels)
npx marknest convert README.md -o README.pdf --margin-top 40 --margin-bottom 40

PDF Metadata

npx marknest convert README.md -o README.pdf --title "Project Guide" --author "Team"

Header/Footer Templates

npx marknest convert README.md -o README.pdf --header-template header.html

Validation

Before converting, you can validate markdown files to catch broken links and rendering issues:

npx marknest validate README.md
npx marknest validate ./docs --all --strict

Combining Multiple Options

A typical full-featured conversion command:

npx marknest convert README.md -o README.pdf \
  --theme github \
  --toc \
  --mermaid auto \
  --math auto \
  --title "Project Documentation" \
  --author "Team Name"

Decision Guide

When the user asks to convert markdown to PDF, follow this logic:

  1. Identify the input: Single file? Folder? ZIP? GitHub URL?
  2. Ask about styling (if not specified): Theme preference? TOC needed?
  3. Check for special content: Does the markdown have Mermaid diagrams or LaTeX math? If yes, add --mermaid auto and/or --math auto.
  4. Determine output: Single PDF (-o) or batch (--out-dir)?
  5. Run the command and verify the output file exists.

If the user has a .marknest.toml config file in their project, marknest will pick it up automatically — no need to pass flags that are already configured there.

Troubleshooting

IssueSolution
"Browser not found"Run npx playwright install chromium
"Playwright runtime package was not found"Run npm ci --prefix <path shown in error>, or set MARKNEST_PLAYWRIGHT_RUNTIME_DIR to a directory containing the playwright runtime
Mermaid diagrams not renderingAdd --mermaid auto flag
Math equations not renderingAdd --math auto flag
Images missing in PDFCheck relative paths; marknest resolves them from the workspace root
Permission denied on outputCheck write permissions on the output directory

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.