# Book Print Obsidian Plugin

Turn your Obsidian notes into professionally printed 6 × 9 physical books in just a few clicks.

![Book Print Obsidian Plugin](docs/assets/banner.png)

---

## Overview

**Book Print Obsidian Plugin** bridges your digital notes and physical bookshelves. It transforms one note or a collection of Markdown notes into a traditionally typeset 6 × 9 trade book with elegant typography, mirrored margins, automatic frontmatter, manual page breaks, custom or generic covers, and direct print-on-demand fulfillment.

### Features
* **Obsidian-Native**: Select single notes, multiple notes, or entire folders to create a book.
* **Non-Destructive Editing**: Edit your working manuscript, reorder chapters, and insert page breaks (`///`) without altering original vault notes.
* **Live 6 × 9 Preview**: Side-by-side Markdown editor and real-time paginated book preview.
* **Zero Cloud Render Cost**: Generates production-ready PDFs locally on your desktop using Electron.
* **Libre Caslon Typography**: Classic trade-book design system using bundled Libre Caslon Text fonts.
* **Print-on-Demand Ready**: Automated Lulu API validation, live shipping quotes, Stripe payment, and direct drop-shipping to your door.

---

## Repository Architecture (Monorepo)

```text
book-print-obsidian/
├── apps/
│   ├── obsidian-plugin/     # Main Obsidian desktop plugin
│   └── api/                 # Thin backend service for quotes, payments, & printer APIs
├── packages/
│   ├── shared/              # Shared types, order state machine, & validation schemas
│   ├── markdown/            # Markdown compiler, wikilinks, & frontmatter engine
│   ├── book-layout/         # 6x9 CSS print rules, typography tokens, & font assets
│   ├── pdf/                 # Electron printToPDF integration & PDF verifier
│   ├── printer/             # Lulu Print API v2 client & MockPrintProvider
│   └── storage/             # Signed S3/R2 object storage provider
└── docs/
    └── integration-notes.md # Technical documentation & API references
```

---

## Quick Start (Development)

### Prerequisites
* Node.js v18+ 
* npm v9+ or pnpm
* Obsidian Desktop v1.4+

### Build & Run
```bash
# Install dependencies
npm install

# Build all packages & plugin
npm run build

# Start plugin watch mode
npm run dev --workspace=apps/obsidian-plugin

# Start backend API dev server
npm run dev --workspace=apps/api
```

---

## License & Attribution

* **Libre Caslon Text**: Licensed under the SIL Open Font License (OFL).
* **Advanced PDF Export**: UX and workflow reference inspired by Advanced PDF Export by ShrekBytes.
