Metadata-Version: 2.4
Name: markpdf-cli
Version: 0.1.1
Summary: A fast, clean CLI tool to convert Markdown files into beautifully styled PDFs.
Author-email: Amritanshu <amritanshu3011@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/therivalkiller/markpdf-cli
Project-URL: Repository, https://github.com/therivalkiller/markpdf-cli
Project-URL: Issues, https://github.com/therivalkiller/markpdf-cli/issues
Keywords: markdown,pdf,converter,cli,weasyprint
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Text Processing :: Markup :: Markdown
Classifier: Topic :: Printing
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: markdown>=3.5
Requires-Dist: weasyprint>=60.0

<p align="center">
  <h1 align="center">📄 markpdf-cli</h1>
  <p align="center">
    <strong>Convert Markdown to beautifully styled PDFs — from the terminal.</strong>
  </p>
  <p align="center">
    <a href="https://pypi.org/project/markpdf-cli/"><img src="https://img.shields.io/pypi/v/markpdf-cli?color=blue&label=PyPI" alt="PyPI"></a>
    <a href="https://pypi.org/project/markpdf-cli/"><img src="https://img.shields.io/pypi/pyversions/markpdf-cli" alt="Python"></a>
    <a href="https://github.com/therivalkiller/markpdf-cli/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="License"></a>
  </p>
</p>

---

**markpdf-cli** is a lightweight command-line tool that takes your `.md` files and produces clean, print-ready PDF documents with professional styling — no configuration needed.

Built with [`python-markdown`](https://python-markdown.github.io/) for parsing and [`WeasyPrint`](https://weasyprint.readthedocs.io/) for rendering.

---

## ⚡ Quick Start

```bash
pip install markpdf-cli
markpdf README.md
```

That's it. You now have a `README.pdf` with beautiful typography and styling.

---

## 🚀 Installation

### From PyPI

```bash
pip install markpdf-cli
```

### From source

```bash
git clone https://github.com/therivalkiller/markpdf-cli.git
cd markpdf-cli
pip install .
```

### System dependencies

WeasyPrint requires some system libraries. Install them **before** using markpdf:

<details>
<summary><strong>Ubuntu / Debian</strong></summary>

```bash
sudo apt update
sudo apt install -y libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 libffi-dev libcairo2
```

</details>

<details>
<summary><strong>macOS (Homebrew)</strong></summary>

```bash
brew install pango libffi
```

</details>

---

## 📖 Usage

### Convert a single file

```bash
markpdf report.md
# → report.pdf
```

### Custom output name

```bash
markpdf report.md -o final-report.pdf
# → final-report.pdf
```

### Convert multiple files (separate PDFs)

```bash
markpdf ch1.md ch2.md ch3.md
# → ch1.pdf  ch2.pdf  ch3.pdf
```

### Merge multiple files into one PDF

```bash
markpdf ch1.md ch2.md ch3.md --merge
# → merged_output.pdf  (page breaks between each file)
```

### Merge with a custom name

```bash
markpdf ch1.md ch2.md ch3.md -m -o book.pdf
# → book.pdf
```

---

## 🐍 Use as a Python library

You can also import `markpdf` directly in your scripts:

```python
from markpdf.converter import convert_single, convert_merged

# Single file
convert_single("notes.md", "notes.pdf")

# Merge multiple files
convert_merged(["ch1.md", "ch2.md", "ch3.md"], "book.pdf")
```

---

## 🏗️ Project Structure

```
markpdf-cli/
├── pyproject.toml          # Build config & metadata
├── README.md
├── .gitignore
└── src/
    └── markpdf/
        ├── __init__.py     # Version
        ├── cli.py          # CLI entry point (argparse)
        └── converter.py    # Core MD → HTML → PDF logic
```

---

## 🤝 Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.

```bash
git clone https://github.com/therivalkiller/markpdf-cli.git
cd markpdf-cli
pip install -e .
```

---

## 📄 License

MIT © [Amritanshu](https://github.com/therivalkiller)
