-
Notifications
You must be signed in to change notification settings - Fork 67
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
base: master
Are you sure you want to change the base?
Conversation
…ovided by the source
… 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
…e figure anchor IDs in one of the files
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. |
I had the same problem with Google Play Books, it didn't accept the current epub. |
@NicoNam didn't work for me. |
@spiralman / @NicoNam can you guys post the actual .epub you generated that worked with Google Play Books? |
@justinkelly Yeah, I think I still have a generated copy lying around. I'll try to post it tonight. |
@justinkelly I created a release in my branch, here: https://github.com/spiralman/sicp/releases/tag/v0.1 |
@spiralman thanks! uploaded perfectly into google play books |
thanks so much for this! Worked great even on my iPad. |
@spiralman thanks. I had the same problem, but your version works on google play books. |
Is there an intention to merge this? |
What should happen to this PR? |
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.