Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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)

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

FeatureDescription
Typst-nativeFirst-class support for Typst documents
Multi-platformPublish to 20+ platforms with one command
AST-centricUnified internal representation for consistent output
Asset handlingAutomatic image embedding, upload, or external storage
RFC-drivenFormal 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:

  1. Resolve — Resolve content input and metadata
  2. Render — Render source content into HTML string
  3. Parse — Parse HTML string into unified AST
  4. Transform — Apply shared AST transformations
  5. Specialize — Create platform-specific payload
  6. Provision — Ensure remote resources exist
  7. Materialize — Upload/resolve assets
  8. Serialize — Convert to platform format
  9. Publish — Send to platform API
  10. Persist — Save publish status

Each adapter implements stages 5-9, inheriting common behavior from stages 1-4.