IAC-099 Module 4: Publisher
Export polished content to PDF or serverless blog.
Purpose
Takes AI-polished content and publishes it either as a local PDF or to a serverless Astro blog via GitHub → Vercel deployment.
Input: polished.md - AI-enhanced content from Module 3
Output:
- Option 1:
output.pdf - Local PDF file
- Option 2: Published blog post (GitHub → Vercel)
Tech Stack
- Framework: Tauri 2
- Frontend: Svelte 5
- Blog Engine: Astro 5 (static site generation)
- Deployment: Vercel (via GitHub integration)
- PDF Generation: [To be selected]
- Platform: macOS (Apple Silicon M2)
Prerequisites
- macOS with Apple Silicon (M2/M3)
- Node.js 20 (via nvm)
- Rust (latest stable)
- Git + GitHub CLI (
gh)
- Vercel account (for blog publishing)
Installation
# Use Node 20
nvm use 20
# Install dependencies
npm install
# Set up Astro blog template
cd blog-template
npm install
Development
# Start dev server
npm run tauri:dev
# Preview Astro blog locally
cd blog-template
npm run dev
# Run tests
npm test
Building
# Build production app
npm run tauri:build
Usage
Option 1: Export to PDF
- Load
polished.md from Module 3
- Click "Export as PDF"
- Choose save location
- PDF generated locally
Option 2: Publish to Blog
- Load
polished.md from Module 3
- Enter blog post metadata:
- Title
- Description
- Tags
- Author
- Click "Publish to Blog"
- App creates:
- New markdown file in Astro content collection
- Git commit with content
- Push to GitHub
- Vercel automatically deploys updated blog
- User receives published URL
Blog Configuration
GitHub Setup
# Authenticate GitHub CLI
gh auth login
# Configure blog repository
export BLOG_REPO=extrophi/your-blog-repo
export BLOG_BRANCH=main
Vercel Setup
- Connect GitHub repository to Vercel
- Configure build settings:
- Framework: Astro
- Build command:
npm run build
- Output directory:
dist
- Enable automatic deployments
Blog Template
Based on working implementation:
/Users/kjd/seanchai-digital/seanchai-digital/
PDF Generation Options
Under Evaluation:
- Puppeteer (Chrome headless)
- Playwright (WebKit)
- wkhtmltopdf
- Prince XML
- Pandoc + LaTeX
Selection Criteria:
- Works on Apple Silicon
- Generates high-quality PDFs
- Handles markdown well
- Lightweight dependencies
Configuration
- Blog repository URL
- Vercel deployment settings
- PDF template/styling
- Default metadata
- Content categories
Source Code References
Based on working implementation from:
/Users/kjd/seanchai-digital/seanchai-digital/ - Astro blog (deployed)
Success Criteria
- ✅ Loads markdown
- ✅ Generates PDF locally
- ✅ OR publishes to Astro blog via GitHub → Vercel
- ✅ Blog template works and deploys
- ✅ Clear success/error feedback
Architecture
src/
├── components/ # Svelte UI components
│ ├── PDFExporter.svelte
│ └── BlogPublisher.svelte
├── lib/
│ ├── pdf/ # PDF generation
│ └── git/ # GitHub operations
└── tauri/ # Rust backend
blog-template/ # Astro blog
├── src/
│ ├── content/ # Markdown posts
│ ├── layouts/
│ └── pages/
└── astro.config.mjs
Privacy & Security
- PDF generation happens locally
- GitHub credentials managed via
gh CLI
- No content stored in cloud (except published blog)
- User controls what gets published
- Local preview before publishing
Workflow Diagram
polished.md
↓
[Publisher App]
↓
├─→ [PDF Generator] → output.pdf
└─→ [Blog Publisher] → GitHub → Vercel → Live Blog
License
[To be determined]
Contributing
See main project repository for contribution guidelines.