Markdown to PDF converter with GitHub-style rendering
Project description
ghpdf
A CLI tool to convert Markdown files to PDF with GitHub-style rendering.
Installation
pip install ghpdf
Or with pipx (recommended for CLI tools):
pipx install ghpdf
Quick Start
# Convert a file
ghpdf README.md -o output.pdf
# Auto-name output (README.md → README.pdf)
ghpdf README.md -O
Usage
ghpdf [OPTIONS] [FILES]...
Options
| Flag | Long | Description |
|---|---|---|
-o |
--output |
Output filename (single file or stdin only) |
-O |
--remote-name |
Auto-name output (input.md → input.pdf) |
-n |
--page-numbers |
Add page numbers at bottom center |
-q |
--quiet |
Suppress progress output |
-V |
--version |
Show version and exit |
Examples
# Single file with explicit output
ghpdf README.md -o documentation.pdf
# Auto-name output (README.md → README.pdf)
ghpdf README.md -O
# Bulk convert all markdown files
ghpdf *.md -O
# With page numbers
ghpdf report.md -O -n
# Stdin to file
echo "# Hello World" | ghpdf -o hello.pdf
# Stdin to stdout (for piping)
cat document.md | ghpdf > output.pdf
# Quiet mode for scripting
ghpdf *.md -O -q
Features
- GitHub-flavored markdown styling
- Syntax highlighting for code blocks
- Tables, task lists, footnotes, and more
- Page break support
- Optional page numbers
- Bulk conversion
- Stdin/stdout piping
Supported Markdown
Headings, bold, italic, strikethrough, lists, task lists, code blocks, inline code, tables, blockquotes, horizontal rules, links, images, footnotes, definition lists, abbreviations, and admonitions.
Page Breaks
Insert page breaks using any of these formats:
---pagebreak---
<!-- pagebreak -->
\pagebreak
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ghpdf-1.0.0.tar.gz.
File metadata
- Download URL: ghpdf-1.0.0.tar.gz
- Upload date:
- Size: 38.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d486e50e436b58c2100c129f566a729dd7b0da4a6d189717c0c8106cb949832
|
|
| MD5 |
f97d5eed292d18556f94490c89d32ce0
|
|
| BLAKE2b-256 |
787bba1590987ac3bfd98742a4a0b99646e9dae4da39180d7c6df354811e14ae
|
File details
Details for the file ghpdf-1.0.0-py3-none-any.whl.
File metadata
- Download URL: ghpdf-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4159b605014bbe4e984e7256551426173a3ea66faeec65b0e0e3a7ec8c3991da
|
|
| MD5 |
187b9b5bbe17d4dca72e7735d875e182
|
|
| BLAKE2b-256 |
740c534833f1465461ae1add54fab2592f9c504e7b3884d97b0ad364eae253d6
|