btzr-io / Villain

A free and open source web-based comic book reader.
https://villain.js.org
MIT License
258 stars 103 forks source link

Ebooks integration #230

Closed btzr-io closed 4 years ago

btzr-io commented 4 years ago

What other formats should this support besides compressed archives ?

I think epub is a good option, pdf is also commonly used but it wont be a optimized for text content, just images.

Possible solution

https://github.com/mozilla/pdf.js https://github.com/futurepress/epub.js/

DaniAcu commented 4 years ago

I’m super excited to take it. Assign me if you want

btzr-io commented 4 years ago

@DaniAcu I'm not sure whats the right approach to handle this, or if is relevant to have internally, maybe create a plugin for this ? https://github.com/btzr-io/Villain/issues/214

DaniAcu commented 4 years ago

Awesome. Let me spike that on this week and share some ideas about how start with that

DaniAcu commented 4 years ago

I tried many ideas and read a lot. So now I think that we could use a Factory. Check this sample and tell me if you are agree with that and I could start implementing that. https://sourcemaking.com/design_patterns/factory_method/java/1

btzr-io commented 4 years ago

@DaniAcu Looks interesting, sure feel free to open a PR, let me know if you have more questions or need any help :v:

DaniAcu commented 4 years ago

Thanks maybe if you have some documentation about how works the renderer or some overview could be helpful.

btzr-io commented 4 years ago

The render is just a react component for openseadragon https://github.com/btzr-io/Villain/blob/master/packages/villain-react/src/components/render.js There are no docs of villain yet, but this should help: https://openseadragon.github.io/docs/

Ebooks shouldn't use this anyway.

btzr-io commented 4 years ago

@DaniAcu Hooks should help with this #446

DaniAcu commented 4 years ago

I was looking into all the code. The first one is that all files that we are supporting, is support like image containers. Because on uncompress.js we are creating pages according to the image that we have on the Blob. If we just support images, because that it's rendered just comics. It's fine and epub is already supported. But if we want to extend our reader to be used on books or other things. What it's the idea, we won't go to support another style of file or we are just supporting comics.

btzr-io commented 4 years ago

It's fine and epub is already supported

Epub is not supported yet, thats why I open this issue to track development of more ebook formats like epub pdf etc...

btzr-io commented 4 years ago

The priority is to support comic-archive files, but if we could extend the support to other files / formats that will be great. Maybe as a plugin or extension if is not a viable option to add it in the main repo.

btzr-io commented 4 years ago

This definitely should be a plugin or extension, not priority, I'll close this for now.