Liepress
A Rust implementation of a Markdown to PDF/SVG/PNG document generator with CSS styling support.
Features
- Markdown to PDF / SVG / PNG — Convert Markdown documents into multiple output formats
- CSS Styling — Full CSS selector and property support via built-in stylesheet, external CSS files, or inline
<style>tags in Markdown - GFM Support — GitHub Flavored Markdown including tables, task lists, strikethrough, code blocks with language tags
- Auto Font Detection — Automatically detects document language (Chinese, Japanese, Korean, Latin) and recommends matching fonts
- Page Layout — A4 default, configurable page size/margins via
@pageCSS rules, auto pagination with widow/orphan control - Header & Footer — Configurable page headers (with separator line) and footers with page number templates
{page}/{total} - Hyperlinks — Clickable links in PDF output, works across line breaks
- Tables — Column-width auto-sizing, cross-page splitting, header/alternate row styling
- Images — Auto-scaling, alt text captions, PNG/JPEG/GIF/WebP support
- Code Blocks — Monospace font, gray background, cross-page support
Quick Start
CLI
# Convert to PDF (default)
# Convert to SVG or PNG
# Apply custom CSS stylesheet
# Customize header and footer
# Remove default page number
# Custom page size and margins
# Strict CSS parsing (fail on errors)
Rust API
use ;
let md = "# Hello\n\nThis is a **Markdown** document.";
let pdf = markdown_to_pdf_with_options?;
CSS in Markdown
Document content here...
Installation
Or build from source:
Documentation
- Design Document — Architecture, module design, and development guide
liepress --help— CLI usage and all available options
License
Licensed under either of:
at your option.