Introduction
typub is a multi-platform content publishing pipeline for Typst documents. Write once in Typst, publish everywhere.
Audience and Reading Paths
User Path (publishing content)
- Start here: Guide Overview
- Getting Started for first publish
- Adapters for platform setup
- Asset Handling for image strategy
- Theme Customization for custom CSS and overrides
- Copy-paste Profiles for manual publishing targets
- Platforms Overview for per-platform instructions
- Advanced Customization for layered config and advanced overrides
Developer Path (contributing to typub)
- RFC specs: RFC Index
- ADR decisions: ADR Index
- Governance history and execution trace:
docs/work/entries
At a Glance
content.typ ┬ content.md
│
┌─────────────┴─────────────┐
│ typub render │
│ ↓ │
│ Semantic Document IR │
└─────────────┬─────────────┘
│
┌────────┬────────┬────────┬────────┬────────┐
↓ ↓ ↓ ↓ ↓ ↓
┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐┌──────┐
│ Ghost││Dev.to││ Hash ││Notion││ WP ││Conf. │
└──────┘└──────┘└──────┘└──────┘└──────┘└──────┘
┌────────┬────────┬────────┐
↓ ↓ ↓ ↓
┌──────┐┌──────┐┌──────┐┌──────┐
│ Astro││Static││ XHS ││20+ CP│
└──────┘└──────┘└──────┘└──────┘
Core Capabilities
| Feature | Description |
|---|---|
| Typst-native | First-class support for Typst documents |
| Multi-platform | Publish to 20+ platforms with one command |
| AST-centric | Unified internal representation for consistent output |
| Asset handling | Automatic image embedding, upload, or external storage |
| RFC-driven | Formal specifications ensure predictable behavior |
Supported Target Types
- API-based adapters (direct publish)
- Local-output adapters (generated local artifacts)
- Copy-paste profiles (manual publish via prepared content)
See Adapters for setup model and Platforms for concrete per-platform instructions.
Quick Start
# Install
cargo install typub
# Initialize a content project
typub init
# Publish to Dev.to
typub publish path/to/post -p devto
# Preview for WeChat (copy-paste)
typub dev path/to/post -p wechat
Pipeline (Conceptual)
typub processes content through a 10-stage pipeline:
- Resolve — Resolve content input and metadata
- Render — Render source content into HTML string
- Parse — Parse HTML string into unified AST
- Transform — Apply shared AST transformations
- Specialize — Create platform-specific payload
- Provision — Ensure remote resources exist
- Materialize — Upload/resolve assets
- Serialize — Convert to platform format
- Publish — Send to platform API
- Persist — Save publish status
Each adapter implements stages 5-9, inheriting common behavior from stages 1-4.