No description
Find a file
Théophile Gervreau-Mercier bfee2f644b Fixed leftover from rebase
2026-02-01 12:04:47 +01:00
internal Initial commit 2026-02-01 12:03:37 +01:00
.gitignore Fixed leftover from rebase 2026-02-01 12:04:47 +01:00
go.mod Initial commit 2026-02-01 12:03:37 +01:00
go.sum Initial commit 2026-02-01 12:03:37 +01:00
LICENSE Initial commit 2026-02-01 11:53:59 +01:00
main.go Initial commit 2026-02-01 12:03:37 +01:00
README.md Initial commit 2026-02-01 12:03:37 +01:00

gtome - Terminal EPUB Reader

A beautiful terminal-based EPUB reader built with Go, using the Bubble Tea and Charm libraries.

Features

  • Page-based reading with automatic text wrapping and pagination
  • Vim-style keybindings for navigation (h/j/k/l)
  • Arrow key support for navigation
  • Table of Contents (TOC) viewer
  • Visual mode for text selection
  • Clipboard integration - copy selected text
  • Help modal with all keybindings
  • Responsive - adapts to terminal size

Installation

go build -o gtome .

Usage

./gtome <path-to-epub-file>

Keybindings

Navigation

  • h, , PageUp - Previous page
  • l, , PageDown, Space - Next page
  • j, - Scroll down
  • k, - Scroll up
  • g, Home - Jump to first page
  • G, End - Jump to last page

Modes

  • ? - Toggle help (show all keybindings)
  • t - Open table of contents
  • v - Enter visual mode (text selection)

Visual Mode

  • j, - Extend selection down
  • k, - Extend selection up
  • y - Yank (copy) selection to clipboard
  • esc, v - Exit visual mode

General

  • q, Ctrl+C - Quit application

Project Structure

gtome/
├── main.go                    # Entry point
├── internal/
│   ├── epub/
│   │   └── parser.go         # EPUB parsing logic
│   └── ui/
│       └── model.go          # Bubble Tea UI model
├── go.mod
└── README.md

Dependencies

How It Works

  1. EPUB Parsing: The application parses EPUB files (which are ZIP archives) and extracts:

    • Book metadata (title, author)
    • Chapter content from HTML/XHTML files
    • Table of contents from NCX navigation files
  2. Text Rendering: HTML content is converted to plain text and wrapped to fit the terminal width

  3. Pagination: Content is automatically paginated based on terminal height

  4. Visual Mode: Allows you to select multiple lines of text and copy them to the system clipboard

License

MIT