reintroduced epub support

This commit is contained in:
Agel committed 2026-10-25 19:59:23 +01:00
1 parent 49a959a89d
commit d14170a68f
49 files changed
+5048 -205

No files matched your search

+1 -3
View File
@@ -163,7 +163,7 @@ When `CMakeLists.txt` gains a new `find_package` or `pkg_check_modules` dependen
### Content Model
All format readers produce normalized HTML content organized into chapters. Each chapter's content is split into chunks (a `QStringList`) at the reader level, where the format structure is known. This enables virtualized rendering via `ListView` in QML. The content model is defined in `FormatReader.h`:
All format readers produce normalized content organized into chapters. Each chapter's content is represented as chunks (a `QStringList` of standalone fragments) to enable virtualized rendering via `ListView` in QML. The content model is defined in `FormatReader.h`:
```cpp
struct TocEntry {
@@ -189,8 +189,6 @@ struct Chapter {
Chapter mapping by format: TXT = 1 chapter (whole file). FB2 = `<section>` elements. EPUB = spine items. CBZ = 1 chapter (whole archive). PDF = outline entries or individual pages.
**Chunking:** Each format reader splits content into chunks natively — chunking at the reader level is trivial and reliable compared to splitting arbitrary HTML. TxtReader splits raw text at ~4096 character boundaries (preferring `\n`, falling back to whitespace), then converts each chunk to HTML independently. Each chunk is a standalone HTML fragment (contains its own `<p>` tags).
**ReadingModel** is a `QAbstractListModel` exposing chunks via `ContentRole`. `PageView.qml` renders chunks in a `ListView` with `cacheBuffer` for seamless scrolling — no visible seams between chunks.
**Progress tracking** to track reading position ONLY ListView y offset must be used. Current page / progress percentage must be calculated using this and total height only.