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
Release files for ghpdf 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ghpdf-1.0.0.tar.gz | 38.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ghpdf-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 46.8 kB
Release files / ghpdf-1.0.0.tar.gz
| Download URL | ghpdf-1.0.0.tar.gz |
|---|---|
| Size | 38.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0d486e50e436b58c2100c129f566a729dd7b0da4a6d189717c0c8106cb949832
|
|
BLAKE2b-256 checksum How to use checksums |
787bba1590987ac3bfd98742a4a0b99646e9dae4da39180d7c6df354811e14ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / ghpdf-1.0.0-py3-none-any.whl
| Download URL | ghpdf-1.0.0-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4159b605014bbe4e984e7256551426173a3ea66faeec65b0e0e3a7ec8c3991da
|
|
BLAKE2b-256 checksum How to use checksums |
740c534833f1465461ae1add54fab2592f9c504e7b3884d97b0ad364eae253d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|