diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..12c4417
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,61 @@
+name: CI
+
+on:
+ push:
+ branches: [main]
+ pull_request:
+ branches: [main]
+
+permissions:
+ contents: read
+
+jobs:
+ lint:
+ name: Type Check
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 22
+ cache: npm
+ - run: npm ci
+ - run: npm run lint
+
+ build:
+ name: Build
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ node-version: [18, 20, 22]
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: ${{ matrix.node-version }}
+ cache: npm
+ - run: npm ci
+ - run: npm run build
+ - name: Verify dist output
+ run: |
+ test -f dist/index.js
+ test -f dist/index.cjs
+ test -f dist/index.d.ts
+ test -f dist/react.js
+ test -f dist/react.cjs
+ test -f dist/react.d.ts
+
+ test:
+ name: Test
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ node-version: [18, 20, 22]
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: ${{ matrix.node-version }}
+ cache: npm
+ - run: npm ci
+ - run: npm test
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..97dd019
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,31 @@
+name: Release
+
+on:
+ push:
+ tags:
+ - 'v*'
+
+permissions:
+ contents: read
+
+jobs:
+ publish:
+ name: Publish to npm
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ id-token: write
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 22
+ cache: npm
+ registry-url: https://registry.npmjs.org
+ - run: npm ci
+ - run: npm run lint
+ - run: npm test
+ - run: npm run build
+ - run: npm publish --provenance --access public
+ env:
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
diff --git a/README.md b/README.md
index 10545f5..31152ca 100644
--- a/README.md
+++ b/README.md
@@ -1,56 +1,187 @@
# @readmigo/reader-engine
-A CSS column-based pagination engine for rendering book chapter HTML in web environments.
+[](https://github.com/readmigo/reader-engine/actions/workflows/ci.yml)
+[](./LICENSE)
+[](https://www.typescriptlang.org/)
+[](https://nodejs.org/)
+
+A CSS column-based pagination engine for rendering book chapter HTML in web environments. Built with TypeScript, ships as ESM and CJS with full type declarations.
+
+---
## Features
-- **HTML Pagination** - CSS column layout engine that splits chapter HTML into discrete pages
-- **Scroll Mode** - Alternative continuous scroll reading mode with progress tracking
-- **Typography Settings** - Configurable font size, family, line height, letter spacing, word spacing, paragraph spacing, text alignment, and hyphenation
-- **Theme System** - Four built-in themes: Light, Sepia, Dark, and Ultra Dark
-- **Chapter Navigation** - Chapter manager with ordered traversal, jump-to-chapter, and boundary detection
-- **Reading Progress** - Combined chapter + page progress calculation (0 to 1)
-- **Content Security** - DOMPurify-based HTML sanitization before rendering
-- **React Wrapper** - Provider, View component, and hooks for React integration
-- **Dual Format** - Ships as ESM and CJS with full TypeScript declarations
+| Feature | Description |
+|---------|-------------|
+| 📖 **HTML Pagination** | CSS column layout engine that splits chapter HTML into discrete pages |
+| 📜 **Scroll Mode** | Alternative continuous scroll reading mode with progress tracking |
+| 🔤 **Typography Settings** | Configurable font size, family, line height, letter/word spacing, paragraph spacing, text alignment, and hyphenation |
+| 🎨 **Theme System** | Four built-in themes — Light, Sepia, Dark, and Ultra Dark |
+| 🧭 **Chapter Navigation** | Chapter manager with ordered traversal, jump-to-chapter, and boundary detection |
+| 📊 **Reading Progress** | Combined chapter + page progress calculation (0 to 1) |
+| 🔒 **Content Security** | DOMPurify-based HTML sanitization before rendering |
+| ⚛️ **React Wrapper** | Provider, View component, and hooks for React integration |
+| 📦 **Dual Format** | Ships as ESM and CJS with full TypeScript declarations |
## Installation
-```
+```bash
npm install @readmigo/reader-engine
```
-## Architecture
+For React integration:
+
+```bash
+npm install @readmigo/reader-engine react react-dom
+```
+
+## Quick Start
-See [docs/ARCHITECTURE.md](./docs/ARCHITECTURE.md) for module diagrams and data flow.
+### Vanilla TypeScript
-## Design Document
+```typescript
+import { ReaderEngine } from '@readmigo/reader-engine';
-See [docs/DESIGN.md](./docs/DESIGN.md) for detailed design documentation covering architecture decisions, core mechanisms, data flow, security, and extensibility.
+const engine = new ReaderEngine({
+ apiBaseUrl: 'https://api.readmigo.com',
+ settings: { theme: 'sepia', fontSize: 20 },
+});
-## API Reference
+// Mount to a DOM container
+engine.mount(document.getElementById('reader')!);
-See [docs/API.md](./docs/API.md) for complete type and method documentation.
+// Load a book and its first chapter
+const book = await engine.loadBook('book-123');
+await engine.loadChapter(0);
-## Getting Started
+// Navigate pages
+engine.nextPage();
+engine.prevPage();
-See [docs/GETTING-STARTED.md](./docs/GETTING-STARTED.md) for setup and integration guides.
+// Listen for state changes
+engine.callbacks.onStateChange = (state) => {
+ console.log(`Page ${state.currentPage + 1}/${state.totalPages}`);
+};
+```
+
+### React
+
+```tsx
+import React, { useEffect } from 'react';
+import { ReaderProvider, ReaderView, useReader } from '@readmigo/reader-engine/react';
+
+function App() {
+ return (
+
Progress: {(state.overallProgress * 100).toFixed(1)}%
+