Skip to content

LeafPress

Convert MkDocs sites to branded PDF and Word documents — from the CLI, desktop, or CI.

Home

PyPI License: MIT CI

Multiple Output Formats

Generate PDF, DOCX, HTML, ODT, EPUB, and Markdown files from any MkDocs project with a single command.

Custom Branding

Cover pages, logos, colors, and footers — all configurable via leafpress.yml.

Git-Aware

Automatically embeds tag, branch, commit hash, and date into your documents.

Package Version Detection

Automatically reads your project version from pyproject.toml, package.json, Cargo.toml, and more — shown alongside git info without any configuration.

CLI & Desktop UI

Use the command line for automation or the desktop app for a visual workflow.

CI / CD Pipelines

Run in GitHub Actions, GitLab CI, or any pipeline with environment variables.

Remote Sources

Convert directly from git URLs — no need to clone repos manually.

Monorepo Support

Combine multiple MkDocs projects into one document — local paths or git URLs with per-project metadata.

Diagram Fetching

Pull diagrams from URLs or Lucidchart before converting — with built-in caching.

Document Import

Import Word, PowerPoint, Excel, and LaTeX files to Markdown with image extraction, code block detection, tables, and math support.

Doctor Command

Run `leafpress doctor` to diagnose your environment — checks dependencies, system libs, and suggests fixes.

Docker Support

Run in a container with all dependencies included — no system setup required.

Quick Start

$ pip install leafpress
---> 100%
Successfully installed leafpress

$ leafpress init
Created leafpress.yml

$ leafpress convert . -f pdf -o dist/
Converting MkDocs site to PDF...
✓ dist/docs.pdf

$ leafpress convert . -f all -c leafpress.yml -o dist/
Converting MkDocs site to all formats...
✓ dist/docs.pdf
✓ dist/docs.docx
✓ dist/docs.html
✓ dist/docs.odt
✓ dist/docs.epub
✓ dist/docs.md

Next Steps