No description
- Go 100%
| internal | ||
| .gitignore | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| main.go | ||
| README.md | ||
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 pagel,→,PageDown,Space- Next pagej,↓- Scroll downk,↑- Scroll upg,Home- Jump to first pageG,End- Jump to last page
Modes
?- Toggle help (show all keybindings)t- Open table of contentsv- Enter visual mode (text selection)
Visual Mode
j,↓- Extend selection downk,↑- Extend selection upy- Yank (copy) selection to clipboardesc,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
- Bubble Tea - Terminal UI framework
- Lipgloss - Style definitions for terminal UI
- clipboard - Clipboard access
- golang.org/x/net/html - HTML parsing
How It Works
-
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
-
Text Rendering: HTML content is converted to plain text and wrapped to fit the terminal width
-
Pagination: Content is automatically paginated based on terminal height
-
Visual Mode: Allows you to select multiple lines of text and copy them to the system clipboard
License
MIT