reintroduced epub support
This commit is contained in:
49 files changed
+5048
-205
No files matched your search
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user