Replace epub.js with foliate-js for EPUB rendering#5
Merged
gvonness-apolitical merged 20 commits intofeat/initial-implementationfrom Feb 1, 2026
Merged
Conversation
This commit introduces the complete MVP for Speed-Read, a lightweight embeddable document reader for EPUB, PDF, and CBZ files. Key features: - Core validation layer (file size, magic bytes, DRM detection) - Format-specific readers (EPUB via epub.js, PDF via pdf.js, CBZ via native ZIP) - Unified page controller with keyboard and touch navigation - Web Component <speed-reader> using Lit - React <Reader /> component - Manifest support for episodic/serial content - CSS custom properties for theming - CI/CD workflows (CI, release, docs) - Comprehensive documentation and demo site Tested with 32 unit tests covering validation and navigation.
…mo (#3) - Add sample test files (EPUB, PDF, CBZ) for manual testing - Add comprehensive troubleshooting guide with CORS solutions - Update demo page with sample file buttons and better UX - Link troubleshooting from getting-started docs
npm rejected "speed-read" as too similar to existing "speedread". Updated all documentation and CDN references to use the scoped name.
- Update all repository URLs and links - Update GitHub Pages URL - Update CODEOWNERS - Switch release workflow to npm Trusted Publishing (OIDC)
- Add sample files to docs build output - Fix sample URLs to work with base path - Add vite.dev.config.ts for local development with samples - Update roadmap with completed items
Previous sample.pdf was returning HTML from source. Replaced with Mozilla pdf.js test file which is properly licensed (Apache 2.0).
The cdnjs CDN doesn't have pdfjs-dist v4.0.379. Switch to jsdelivr which serves npm packages directly and has the correct version.
- Change reader-content overflow from hidden to auto for scrolling - Center content in reader container - Fix PDF scaling to fit both width and height - Improve CBZ decompression with better error handling
Workflows: - Update all workflows to use self-hosted runners EPUB reader: - Use explicit pixel dimensions for epub.js rendering CBZ reader: - Rewrite ZIP parser to use Central Directory for robustness - Handles data descriptors and various ZIP formats correctly Component: - Change overflow from hidden to auto for scrolling - Center content in reader container
- Create absolute-positioned container for epub.js - Remove flexbox centering that interfered with epub.js iframe - Add min-height: 0 for proper flex child sizing
- Use requestAnimationFrame to ensure layout is complete before measuring - Set explicit pixel dimensions on epub container - Remove continuous manager, use default for proper pagination
- Use "100%" width string as in epub.js examples - Add padding to body via themes.default - Use position: relative on container
- Switch from epub.js to foliate-js library for better pagination support - Use foliate-js native CSS column-based navigation instead of fraction-based PageController navigation - Add custom keyboard navigation for EPUB that directly uses foliate-js - Add debounced relocate event handling to prevent UI flickering - Fix sample file serving with correct MIME types in dev server - Fix CBZ reader lint error (while loop condition) - Add TypeScript declarations for foliate-js This fixes the issue where EPUB content was getting cut off at page boundaries and navigation was skipping pages incorrectly.
95be2a8 to
fdfd1ce
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
Test plan