orthros / dart-epub

Epub Reader and Writer for Dart
MIT License
218 stars 230 forks source link

[suggestion] Merge implementation of epub_write into epub #30

Open ShadowJonathan opened 6 years ago

ShadowJonathan commented 6 years ago

There's a dart package out there, epub_write, which is supposed to add writing functionality, making it possible to (painstakingly) create epub files directly from epub book "references"

My suggestion, and question, is to merge that functionality into this package?

orthros commented 6 years ago

Hey @ShadowJonathan I actually did a fair amount of the merge between the two last week. If you check the lib/src/epub_writer.dart file and lib/src/writers directory, I tried to merge as much of the functionality as I could. I added a few integration tests for them as well.

Is this what you were looking for?

Thanks!

ShadowJonathan commented 6 years ago

I like it! I havent done a test on it yet (read a epub, then write it again, and compare differences), but so far it seems like a better version of what i managed to write!

orthros commented 6 years ago

I'm glad you like it! I didn't do much other than refactor and split a lot of what was originally in epub_write and added a few extra methods for processing more metadata, so thank you!

I wrote and added a few tests to the package that do round trip to ensure the content that is written can be re-read back. If you want to take a look I'd appreciate it!

ShadowJonathan commented 6 years ago

Will do!

Also I suggest making a "EpubFactory" class, since both EpubRef and EpubBook have "chapter entries" that are desynced from eachother, so a "Factory" class will be very useful when contructing a Epub, and being able to construct that to a legit and fully functional EpubBook that can be written with EpubWriter