Pure Rust HTML/CSS → PDF engine — wkhtmltopdf replacement
Project description
TypePress
Pure Rust HTML/CSS → PDF engine. No browser required.
TypePress renders HTML and Markdown to PDF using fulgur (Blitz → Taffy → Krilla) — zero external dependencies, no Chromium, no Node.js.
Features
- HTML/CSS → PDF — Full HTML rendering with CSS styling
- Markdown → PDF — GFM extensions, code highlighting via syntect
- LaTeX Math —
$...$and$$...$$rendered via katex-rs - Mermaid Diagrams — Flowchart, sequence, class, state, ER diagrams
- CJK Support — Chinese/Japanese/Korean with automatic font subsetting
- Single Binary — ~15MB, zero dependencies, no Chromium/Node.js
- CSS Grid/Flexbox → Table — Automatic layout degradation for taffy compatibility
- Header/Footer — CSS GCPM running elements
- @font-face — Web font loading and embedding
- Small Output — 93KB PDF vs browser screenshots (MB scale)
Quick Start
Install
# Rust / Cargo
cargo install typepress
# npm (Node.js)
npm install typepress-pdf
# pip (Python)
pip install typepress
Basic Usage
# Markdown → PDF
typepress doc.md -o out.pdf
# HTML → PDF with CJK font
typepress page.html -o out.pdf -f /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
# With math support
typepress doc.md -o out.pdf --math
# YAML-driven workflow
typepress render # auto-detects typepress.yaml
Configuration
Create typepress.yaml in your project root:
input: doc.md
from: md
output:
pdf: out.pdf
page:
size: A4
math: true
Comparison
| TypePress | wkhtmltopdf | Puppeteer | Paper Muncher | |
|---|---|---|---|---|
| No browser | ✅ | ✅ | ❌ | ❌ |
| Binary size | ~15MB | ~40MB | ~300MB | ~200MB |
| CSS Grid | 🟡 table fallback | ✅ | ✅ | ✅ |
| Math (KaTeX) | ✅ | ❌ | ❌ | ❌ |
| Mermaid | ✅ | ❌ | ❌ | ❌ |
| Markdown input | ✅ | ❌ | ❌ | ❌ |
| Output size | 93KB | 200KB | 2MB | varies |
Architecture
Markdown/HTML → CSS Layout Preprocess → Header/Footer → Math → Mermaid → Code Highlight → fulgur → PDF
↑
Blitz → Taffy → Krilla
- Blitz — HTML/CSS parsing
- Taffy — CSS box layout engine
- Krilla — PDF generation
- TypePress — Preprocessing pipeline + CLI
Known Limitations
Taffy (layout engine) does not yet support:
- CSS Grid (
display: grid) — automatically converted to<table> - CSS Flexbox (
display: flex) — automatically converted to<table> - CSS gradients — degraded to solid colors
These are transparent preprocess steps; your HTML renders correctly, just with simplified layout.
Contributing
See CONTRIBUTING.md for development setup and workflow.
TypePress follows OpenSpec spec-driven development. Changes are planned in proposal.md → design.md → specs/ → tasks.md before implementation.
License
Licensed under either of MIT or Apache-2.0, at your option.
Based on fulgur (MIT/Apache-2.0).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file typepress-0.4.0.tar.gz.
File metadata
- Download URL: typepress-0.4.0.tar.gz
- Upload date:
- Size: 879.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4ec24a4b7ee0a94b4fe4c468ad094983fbd54c272af9bb643fe185a9a6569d2
|
|
| MD5 |
eca40bd6705255af9986b8f6bb572a87
|
|
| BLAKE2b-256 |
b513b520c14aeb6ed7a0afec24ef6dd04101ffa525703e1e2dd9bcbadc8682dc
|
Provenance
The following attestation bundles were made for typepress-0.4.0.tar.gz:
Publisher:
release.yml on alitrack/typepress
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
typepress-0.4.0.tar.gz -
Subject digest:
e4ec24a4b7ee0a94b4fe4c468ad094983fbd54c272af9bb643fe185a9a6569d2 - Sigstore transparency entry: 1935458973
- Sigstore integration time:
-
Permalink:
alitrack/typepress@30d0804c89f85e07c8c7b462d85a5d2680cffe44 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/alitrack
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@30d0804c89f85e07c8c7b462d85a5d2680cffe44 -
Trigger Event:
push
-
Statement type:
File details
Details for the file typepress-0.4.0-py2.py3-none-any.whl.
File metadata
- Download URL: typepress-0.4.0-py2.py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dace4b53776815d14c81af3b9ff98a861a4dfb2f638fd31d2f824ac728348943
|
|
| MD5 |
cd5a99b24c42b67f4e594dfcdcebaf0b
|
|
| BLAKE2b-256 |
02273f08899c4a033698c1610d11b62710c8f48d24a7473ca6a62cb3527de581
|
Provenance
The following attestation bundles were made for typepress-0.4.0-py2.py3-none-any.whl:
Publisher:
release.yml on alitrack/typepress
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
typepress-0.4.0-py2.py3-none-any.whl -
Subject digest:
dace4b53776815d14c81af3b9ff98a861a4dfb2f638fd31d2f824ac728348943 - Sigstore transparency entry: 1935459078
- Sigstore integration time:
-
Permalink:
alitrack/typepress@30d0804c89f85e07c8c7b462d85a5d2680cffe44 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/alitrack
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@30d0804c89f85e07c8c7b462d85a5d2680cffe44 -
Trigger Event:
push
-
Statement type: