No description
  • Rust 62.8%
  • Svelte 29.5%
  • TypeScript 5.9%
  • CSS 1.4%
  • HTML 0.3%
  • Other 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Christopher Rueber adb363f83f
Some checks failed
Release / build (, macos-latest) (push) Has been cancelled
Release / build (, ubuntu-22.04) (push) Has been cancelled
Release / build (, windows-latest) (push) Has been cancelled
Add cross-platform release workflow (Linux, Windows, macOS)
2026-08-21 18:36:56 -05:00
.github/workflows Add cross-platform release workflow (Linux, Windows, macOS) 2026-08-21 18:36:56 -05:00
src Fix cover page: no heading added, no image distortion 2026-08-21 16:30:26 -05:00
src-tauri Fix cover page: no heading added, no image distortion 2026-08-21 16:30:26 -05:00
.gitignore Initial commit: EPUB editor with Tauri, Svelte, and TipTap 2026-08-20 20:44:24 -05:00
AGENT.md Add MIT license and emphasize testing requirements in AGENT.md 2026-08-21 10:50:29 -05:00
AGENTS.md Update AGENTS.md with critical no-regressions testing policy 2026-08-21 15:09:11 -05:00
index.html Initial commit: EPUB editor with Tauri, Svelte, and TipTap 2026-08-20 20:44:24 -05:00
LICENSE Add MIT license and emphasize testing requirements in AGENT.md 2026-08-21 10:50:29 -05:00
package-lock.json Initial commit: EPUB editor with Tauri, Svelte, and TipTap 2026-08-20 20:44:24 -05:00
package.json Initial commit: EPUB editor with Tauri, Svelte, and TipTap 2026-08-20 20:44:24 -05:00
README.md Update README with current features and implementation details 2026-08-21 16:42:46 -05:00
svelte.config.js Initial commit: EPUB editor with Tauri, Svelte, and TipTap 2026-08-20 20:44:24 -05:00
tsconfig.json Initial commit: EPUB editor with Tauri, Svelte, and TipTap 2026-08-20 20:44:24 -05:00
vite.config.ts Initial commit: EPUB editor with Tauri, Svelte, and TipTap 2026-08-20 20:44:24 -05:00

WritePub

A minimalist EPUB editor built with Tauri, Svelte, and TipTap. Open, edit, and save EPUB files with a distraction-free writing experience.

Version License

Features

  • Distraction-free editing - Clean, minimalist interface inspired by iA Writer
  • Full EPUB 3.3 support - Open and save EPUB files with full standard compliance
  • Rich text editing - Bold, italic, underline, headings, lists, tables, images
  • Chapter management - Drag-and-drop chapter reordering with collapsible sidebar
  • Cover page handling - Proper cover image display with aspect ratio preservation
  • Dark mode - Toggle between light and dark themes (persisted)
  • Customizable settings - Line spacing and chapter density options (persisted)
  • Zathura compatibility - Fixed list styling for proper rendering in Zathura
  • Cross-platform - Runs on Windows, macOS, and Linux
  • Small footprint - ~10MB bundle size thanks to Tauri

Installation

Pre-built binaries

Download the latest release from the Releases page.

Build from source

Prerequisites

Build steps

# Clone the repository
git clone https://git.packden.us/crueber/writepub.git
cd writepub

# Install dependencies
npm install

# Run in development mode
npm run tauri dev

# Build for production
npm run tauri build

The built application will be in src-tauri/target/release/bundle/.

Usage

Opening an EPUB

  1. Click Open in the header or press Ctrl+O (Cmd+O on Mac)
  2. Select an EPUB file
  3. The book's chapters will appear in the sidebar

Editing

  • Click a chapter in the sidebar to edit it
  • Select text to see formatting options
  • Use the toolbar for:
    • Bold, Italic, Underline
    • Headings (H1, H2, H3)
    • Bullet and numbered lists
    • Tables (insert, add/delete rows and columns)
    • Images (insert and manage)

Managing chapters

  • Add chapter: Click the + button in the sidebar
  • Delete chapter: Hover over a chapter and click the × button
  • Reorder chapters: Drag and drop chapters in the sidebar
  • Change heading level: Click the level button (H1, H2, etc.) to change heading hierarchy

Cover pages

Cover pages are handled specially:

  • No heading is added to cover pages
  • Cover images maintain their aspect ratio (no stretching)
  • Images are centered and scaled to fit the viewport
  • Change cover image via the "Change Cover Image" button

Settings

Access settings from the sidebar menu:

  • Line spacing: Compact, normal, or relaxed
  • Chapter density: Compact, normal, or comfortable sidebar view
  • Theme: Toggle dark mode

All settings are persisted across sessions.

Saving

  • Click Save or press Ctrl+S (Cmd+S on Mac)
  • If it's a new file, you'll be prompted to choose a location
  • The EPUB will be saved with all your changes

Architecture

WritePub is built with a modern, lightweight stack:

Frontend

  • Svelte 5 - Reactive UI framework with minimal overhead
  • TipTap - Headless rich text editor built on ProseMirror
  • Vite - Fast build tool and dev server

Backend

  • Tauri - Cross-platform desktop app framework
  • Rust - Safe, fast systems programming
  • zip - EPUB archive handling
  • quick-xml - XML parsing for EPUB structure

Key components

src/
├── lib/
│   ├── editor/          # TipTap editor component
│   ├── sidebar/         # Chapter list with drag-and-drop
│   ├── components/      # CoverView, UnsavedChangesDialog
│   └── store/           # Svelte stores (project, theme, settings)
└── styles/              # Global CSS with dark mode support

src-tauri/
└── src/
    ├── epub/            # EPUB parsing and writing
    │   ├── parser.rs    # Read EPUB files
    │   └── writer.rs    # Write EPUB files
    └── commands.rs      # Tauri commands (frontend <-> backend)

Development

Project structure

  • src/ - Svelte frontend
  • src-tauri/ - Rust backend
  • package.json - Node.js dependencies
  • tauri.conf.json - Tauri configuration

Commands

# Development
npm run tauri dev        # Run in dev mode with hot reload

# Building
npm run tauri build      # Build for production

# Frontend only
npm run dev              # Run Vite dev server
npm run build            # Build frontend
npm run check            # Type check Svelte files

# Backend testing
cd src-tauri
cargo test               # Run all tests

Testing

The project includes comprehensive test coverage:

  • 8 unit tests (parser, writer, CSS handling)
  • 12 integration tests (roundtrip, cover pages, list styling, metadata)

Run tests with:

cd src-tauri && cargo test

Adding features

See AGENTS.md for detailed guidance on extending WritePub, including EPUB compliance requirements and critical implementation details.

Roadmap

  • Book metadata editing (title, author, language, etc.)
  • Custom CSS editing
  • Table of contents generation
  • Spell checking
  • Word count and statistics
  • Export to other formats (PDF, HTML)
  • Multi-book library management

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE for details.

Acknowledgments

  • Tauri - Cross-platform desktop framework
  • Svelte - Cybernetically enhanced web apps
  • TipTap - Headless rich text editor
  • ProseMirror - Toolkit for building rich text editors

Support

If you encounter any issues or have questions, please open an issue.