Metadata-Version: 2.4
Name: markprint
Version: 0.1.6
Summary: Beautiful, configurable, extensible Markdown-to-PDF rendering for Python.
Author: William R. Astley
License: MIT
Project-URL: Homepage, https://github.com/pr1m8/markprint
Project-URL: Repository, https://github.com/pr1m8/markprint
Project-URL: Issues, https://github.com/pr1m8/markprint/issues
Keywords: markdown,pdf,weasyprint,document,rendering,cli,html,themes
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Documentation
Classifier: Topic :: Text Processing :: Markup :: Markdown
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: markdown-it-py>=3
Requires-Dist: mdit-py-plugins>=0.4
Requires-Dist: linkify-it-py>=2.0
Requires-Dist: jinja2>=3.1
Requires-Dist: pygments>=2.18
Requires-Dist: weasyprint>=62
Requires-Dist: python-frontmatter>=1.1
Requires-Dist: pydantic>=2.8
Requires-Dist: pydantic-settings>=2.0
Requires-Dist: typer>=0.12
Requires-Dist: rich>=13.7
Provides-Extra: logging
Requires-Dist: ultilog>=0.3.0; extra == "logging"
Provides-Extra: logging-full
Requires-Dist: ultilog[full]>=0.3.0; extra == "logging-full"
Provides-Extra: browser
Requires-Dist: playwright>=1.40; extra == "browser"
Provides-Extra: pandoc
Requires-Dist: pypandoc>=1.13; extra == "pandoc"
Provides-Extra: pandoc-binary
Requires-Dist: pypandoc_binary; extra == "pandoc-binary"
Provides-Extra: markdown-python
Requires-Dist: markdown>=3.6; extra == "markdown-python"
Requires-Dist: pymdown-extensions>=10; extra == "markdown-python"
Provides-Extra: pdf
Requires-Dist: pypdf>=5; extra == "pdf"
Requires-Dist: pikepdf>=8; extra == "pdf"
Requires-Dist: pymupdf>=1.24; extra == "pdf"
Provides-Extra: docs
Requires-Dist: mkdocs-material; extra == "docs"
Requires-Dist: myst-parser; extra == "docs"
Requires-Dist: mkdocstrings[python]; extra == "docs"
Requires-Dist: pymdown-extensions; extra == "docs"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: pytest-xdist; extra == "test"
Requires-Dist: pytest-regressions; extra == "test"
Requires-Dist: coverage; extra == "test"
Provides-Extra: dev
Requires-Dist: ruff; extra == "dev"
Requires-Dist: pyright; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Provides-Extra: all
Requires-Dist: ultilog[full]>=0.3.0; extra == "all"
Requires-Dist: playwright>=1.40; extra == "all"
Requires-Dist: pypandoc>=1.13; extra == "all"
Requires-Dist: markdown>=3.6; extra == "all"
Requires-Dist: pymdown-extensions>=10; extra == "all"
Requires-Dist: pypdf>=5; extra == "all"
Requires-Dist: pikepdf>=8; extra == "all"
Requires-Dist: pymupdf>=1.24; extra == "all"
Requires-Dist: mkdocs-material; extra == "all"
Requires-Dist: myst-parser; extra == "all"
Requires-Dist: mkdocstrings[python]; extra == "all"
Requires-Dist: pytest; extra == "all"
Requires-Dist: pytest-cov; extra == "all"
Requires-Dist: pytest-xdist; extra == "all"
Requires-Dist: pytest-regressions; extra == "all"
Requires-Dist: coverage; extra == "all"
Requires-Dist: ruff; extra == "all"
Requires-Dist: pyright; extra == "all"
Requires-Dist: build; extra == "all"
Requires-Dist: twine; extra == "all"
Dynamic: license-file

# Markprint

[![PyPI](https://img.shields.io/pypi/v/markprint.svg)](https://pypi.org/project/markprint/)
[![Python](https://img.shields.io/pypi/pyversions/markprint.svg)](https://pypi.org/project/markprint/)
[![CI](https://github.com/pr1m8/markprint/actions/workflows/ci.yml/badge.svg)](https://github.com/pr1m8/markprint/actions/workflows/ci.yml)
[![Release](https://github.com/pr1m8/markprint/actions/workflows/release.yml/badge.svg)](https://github.com/pr1m8/markprint/actions/workflows/release.yml)
[![Docs](https://readthedocs.org/projects/markprint/badge/?version=latest)](https://markprint.readthedocs.io/en/latest/)
[![License](https://img.shields.io/github/license/pr1m8/markprint.svg)](LICENSE)

**Markprint** is a beautiful, configurable, extensible Markdown-to-PDF renderer for Python.

It is built for developers who want polished PDFs from Markdown without giving up control over themes, profiles, syntax highlighting, document metadata, batch rendering, logging, or advanced rendering backends.

```text
Markdown source
  -> frontmatter and config
  -> parsed document model
  -> HTML body
  -> themed printable HTML
  -> PDF artifact
```

## Why Markprint?

Markdown-to-PDF tooling often falls into two extremes. Some tools are easy but plain. Others are powerful but heavy, requiring Pandoc, LaTeX, browser automation, or lots of project-specific glue. Markprint aims for a better middle path:

- simple by default,
- beautiful out of the box,
- deeply configurable when needed,
- extensible through clean rendering stages,
- useful as both a CLI and Python library.

## Installation

```bash
pip install markprint
```

With optional extras:

```bash
pip install "markprint[logging]"
pip install "markprint[browser]"
pip install "markprint[pandoc]"
pip install "markprint[pdf]"
```

For local development:

```bash
pdm install -G dev -G test -G docs
```

## Quickstart

Render a Markdown file to PDF:

```bash
markprint README.md README.pdf
```

Render raw Markdown:

```bash
markprint render-string "# Hello Markprint" --output hello.pdf
```

Render from stdin:

```bash
echo "# Hello from stdin" | markprint - hello.pdf
```

Compile multiple Markdown files into one PDF:

```bash
markprint compile docs/intro.md docs/usage.md docs/api.md --output manual.pdf
```

## Python API

```python
from pathlib import Path

from markprint import RenderOptions, render_pdf

render_pdf(
    source=Path("README.md"),
    output=Path("README.pdf"),
    options=RenderOptions(theme="github", profile="docs", toc=True),
)
```

Raw Markdown:

```python
from markprint import render_pdf

render_pdf(
    markdown="# Hello

This is **raw Markdown**.",
    output="hello.pdf",
)
```

## Documentation

- Documentation: https://markprint.readthedocs.io/
- PyPI: https://pypi.org/project/markprint/
- Repository: https://github.com/pr1m8/markprint

## Core features

- Markdown file, raw string, stdin, batch, and multi-file input
- YAML frontmatter and project config support
- Themeable Jinja HTML templates
- Pygments syntax highlighting
- WeasyPrint backend by default
- Optional Playwright and Pandoc backends
- Optional ultilog logging integration
- PDF helper extension points
- Plugin-oriented architecture

## Development

```bash
pdm install -G dev -G test -G docs
pdm run ruff check .
pdm run ruff format --check .
pdm run pytest --cov=markprint --cov-report=term-missing
pdm run mkdocs build --strict
```

## License

MIT.
