Commit graph svitak/svitak.cabal
Author SHA1 Message Date
4170a958d1
feature: add split page, scrolled or paginated tracking 2026-07-06 17:44:24 +01:00
2011d638b0
refactor: streaming loader, hierarchical TOC, parser robustness
Rework the reader around a clean BookInfo interface and lazy chapter loading.

Types/parser:
- BookInfo now splits into loadStructure (cheap: spine refs + TOC tree) and renderChapter (one chapter on demand). EpubEnv carries the parsed archive.
- resolveZipPath collapses ./.. and strips #fragments (normalise does not), so relative hrefs like ../Images/x.jpg resolve; used for chapters and images.
- decodeEntry tolerates encodings: UTF-8/UTF-16 BOMs, Latin-1 fallback instead of throwing on invalid bytes.
- Skip spine items with no manifest entry instead of throwing an error.
- Scan the zip for a .opf if container.xml is missing.
- Image inlining rewrites the src URL string, not the whole <img> tag (scalpel
  re-serialises tags, so a whole-tag replace silently missed self-closing imgs).

Navigation:
- Hierarchical TOC: ncxToc (EPUB 2), navToc (EPUB 3), guideToc (<guide> fallback). Nested scrapers use atDepth 1 to take only direct children.

UI:
- Streaming: render the opened chapter on demand, cache it, preload neighbours so arrow paging is instant with a placeholder that covers uncached jumps.
- Sidebar shows the TOC tree with CSS styling. Clicks scroll to #fragments.
- wrapHtml wraps each body in a full HTML document for reliable WebKit render.

Test: 'svitak-test <book> <idx>' dumps one rendered chapter. cabal test stanza fixed to list all needed modules/deps.
2026-06-26 03:45:29 +01:00
5f9369e882
add ghc flags
gtk multithreading doesn't work properly without passing -threaded
added -O for performance
2026-02-27 21:54:44 +00:00
41201ebb58
temporary change 2026-02-20 22:57:46 +00:00
7cd9e79c94 add navigation module 2026-02-11 06:22:09 +00:00
de7a64cade replace tagsoup with scalpel 2026-02-04 06:15:20 +00:00
b24288eb70 add seperate types module 2026-02-05 03:25:31 +00:00
1cab6a9bab seperate state handling logic 2026-02-04 03:51:47 +00:00
a41828dbbd Eager parsing on seperate thread 2026-01-28 19:21:10 +00:00
e1682a861a Implement STM Concurrency
add stm to project file
2026-01-28 18:18:41 +00:00
83a767968b refactor:remove gui.hs 2026-01-27 21:38:28 +00:00
2c06dda760 Update project file
Needed for new test suite
2026-01-26 14:26:29 +00:00
3987c1a853 Begin implementing chapter title parsing
Right now chapter titles are completely plain, parsing the tags will allow us to render it properly.

Revert chapterTitle addition and add it to seperate branch until its completed

Delegating the task of implementing chapter title parsing into a different branch instead of having it incomplete in the main one

Merge chtitle into main
2026-01-26 09:26:45 +00:00
7c92e161cb Add directory to dependencies
Needed for the persistence feature
2026-01-26 07:48:08 +00:00
2f47493d0e Starting work on persistence feature 2026-01-26 06:10:27 +00:00
935dc795d0 Add navigation and proper webkit integration with basic chapter display 2026-01-26 04:30:47 +00:00
396a9cdb16 Add image rendering alongside automatic mimetype detection 2026-01-26 02:59:11 +00:00
685bfea69a Addition to previous commit: Update project dependencies 2026-01-26 02:02:36 +00:00
747c9183a9 Implement epub metadata module to the backend 2026-01-25 04:29:45 +00:00
4bc89a49c1 Add spine to file path resolving 2026-01-24 01:48:02 +00:00
092ef7b8f1 Implement scalpel 2026-01-24 00:56:23 +00:00
2a35aff1b2 Add reader environment 2026-01-24 00:04:45 +00:00
0f9a03822e Add parsing and associated modules 2026-01-23 23:33:00 +00:00
0ac0ae8d61 Updated cabal file and new function 2026-01-23 22:37:35 +00:00
0a24ee986c Initialization 2026-01-21 01:23:54 +00:00