Metadata-Version: 2.4
Name: md-to-pdf-converter
Version: 0.1.1
Summary: Convert Markdown files to well-formatted PDF documents
Author: Hosein Mirhoseini
License: MIT
Keywords: markdown,pdf,converter,cli,reportlab
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: License :: OSI Approved :: MIT License
Classifier: Environment :: Console
Classifier: Topic :: Text Processing :: Markup :: Markdown
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: reportlab>=4.0.0
Requires-Dist: matplotlib>=3.7.0

# Markdown to PDF Converter

A pip-installable Markdown to PDF converter with a command-line interface built on ReportLab and Matplotlib.

## Features

- Converts Markdown files to styled PDF documents
- Supports headings, lists, block quotes, code blocks, tables, images, and math
- CLI with required input and optional output
- Configurable font family
- Configurable color scheme
- Configurable page size

## Installation

Install from this project directory:

```bash
pip install .
```

After installation, the CLI command is available as:

```bash
md-to-pdf
```

## CLI Usage

```bash
md-to-pdf INPUT [OUTPUT] [--font FONT] [--color-scheme {classic,mono,warm}] [--page-size {A4,LETTER,LEGAL}]
```

## Argument Behavior

1. `INPUT` is required.
2. `OUTPUT` is optional. If omitted, output is created next to the input file with `.pdf` suffix.
3. `--font` can be passed.
4. `--color-scheme` can be passed.
5. `--page-size` can be passed.

## Examples

Convert with default output path:

```bash
md-to-pdf Docs/initial_proposal_v2.md
```

Convert with explicit output path:

```bash
md-to-pdf Docs/initial_proposal_v2.md Docs/initial_proposal_v2_custom.pdf
```

Convert with custom font:

```bash
md-to-pdf Docs/initial_proposal_v2.md --font "Times New Roman"
```

Convert with warm color scheme and LETTER page size:

```bash
md-to-pdf Docs/initial_proposal_v2.md --color-scheme warm --page-size LETTER
```

## Python API Usage

```python
from pathlib import Path
from md_to_pdf import markdown_to_pdf

markdown_to_pdf(
    Path("Docs/initial_proposal_v2.md"),
    Path("Docs/initial_proposal_v2.pdf"),
    font="serif",
    color_scheme="classic",
    page_size_name="A4",
)
```

## Notes

- Dependencies are installed automatically through pip: `reportlab`, `matplotlib`
- Image paths in Markdown are resolved relative to the input Markdown file

---

[GitHub Repo]('https://github.com/hoseinmrh/Markdown-to-PDF-Converter')
