Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Few questions about loading epub #28

Open
pravid opened this issue Jul 15, 2024 · 1 comment
Open

Few questions about loading epub #28

pravid opened this issue Jul 15, 2024 · 1 comment
Labels
question Further information is requested

Comments

@pravid
Copy link

pravid commented Jul 15, 2024

Is it possible to secure and stream epub (folder/.epub/.zip file) from server and can we directly pass path of the remote epub folder to book object? Any sample available?

@johnfactotum
Copy link
Owner

Unzipped EPUB folders aren't directly supported. To do it, you can either implement your own loader object, something like

const loader = {
    loadText: x => fetch(x).then(res => res.text()),
    loadBlob: x => fetch(x).then(res => res.blob()),
}
const { EPUB } = await import('./epub.js')
const book = await new EPUB(loader).init()

Or you can just create a book object directly, like

const book = {
   sections: [{ load: () => 'chapter1.html' }],
}

@johnfactotum johnfactotum added the question Further information is requested label Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants