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

Make EPUB file Google Play Books compatible #5

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

spiralman
Copy link
Contributor

This is a very large pull request, and goes in a slightly different direction than some of the previous work, so I don't mind keeping it as its own fork if you don't want to merge it.

My main goal here was to make the epub file compatible with Google Play Books. I used epubcheck (recommended by Google) (https://github.com/IDPF/epubcheck, also available as a web form at http://validator.idpf.org/) to identify issues, and most of the fixes were done automatically using sed or Python.

You can see most of the details in the commit messages. The large majority of the issues are fixes to references in the HTML files and in the TOC itself (removing % signs from the anchor IDs, fixing all the fragment identifiers in the TOC file to match actual IDs in the document and fixing a few other random references). I'm not sure what state of the source you were trying in iBooks, but the fragment IDs in the TOC were completely wrong, which might be why iBooks couldn't follow them (nothing should have been able to).

I also undid the work to break the chapters into sub-files (it was only done to one file, and the internal references weren't fixed; again, that might not have been the problem at all with iBooks?) and to do the SVG conversion (I just wanted something that worked, and having only 33% of the images was generating a lot of errors).

There are actually still a fair number of errors generated by epubcheck, mostly about HTML tags being used in ways that are apparently not allowed in EPUB (nesting paragraphs where they shouldn't be and things like that). I didn't go after those issues yet, since my goal was Google Play compatibility, not pedantically following the EPUB spec.

I looked into using http://dvisvgm.sourceforge.net/ to do the SVG generation, and got good output for the one file I checked by using the -n (font-tracing, not SVG font elements) option, so that might be a simpler way to go for SVG generation than generating raster images and using potrace.

Review on Reviewable

spiralman and others added 26 commits December 5, 2013 17:12
… for real now (epubcheck still complains about 3 that are valid)
… which have been removed; fixing it to handle multiple unnumbered sections with the same name, and updating the toc with latest run
…ing SVG generation for now, since they aren't referenced correctly, anyway
@spiralman
Copy link
Contributor Author

FYI, I tested this in iBooks on my Mac (Mavericks) and the sub-file (fragment) references in the TOC do work in this branch.

Not sure if that's because I fixed the IDs, or if it's something with a newer version of iBooks. I also don't have an iOS device to test it on.

@NicolaeNMV
Copy link

I had the same problem with Google Play Books, it didn't accept the current epub.
I tried to rebuild the .epub with the changes you made here https://github.com/spiralman/sicp and it works.
Thanks a bunch @spiralman !

@iamrahulroy
Copy link

@NicoNam didn't work for me.

@justinkelly
Copy link

@spiralman / @NicoNam can you guys post the actual .epub you generated that worked with Google Play Books?

@spiralman
Copy link
Contributor Author

@justinkelly Yeah, I think I still have a generated copy lying around. I'll try to post it tonight.

@spiralman
Copy link
Contributor Author

@justinkelly I created a release in my branch, here: https://github.com/spiralman/sicp/releases/tag/v0.1

@justinkelly
Copy link

@spiralman thanks! uploaded perfectly into google play books

@brittlewis12
Copy link

thanks so much for this! Worked great even on my iPad.

@doosrasingh
Copy link

@spiralman thanks. I had the same problem, but your version works on google play books.

@Trevoke
Copy link

Trevoke commented Mar 26, 2016

Is there an intention to merge this?

@wontheone1
Copy link

What should happen to this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants