sarabander / sicp

HTML5/EPUB3 version of SICP
http://sarabander.github.io/sicp/
Other
4.35k stars 600 forks source link

Pre-generated EPUB, both packed and exploded versions please (hosted in GitHub's gh-pages) #12

Closed danielweck closed 8 years ago

danielweck commented 8 years ago

Hello, thank you very much maintaining this. The DropBox link is handy ( https://www.dropbox.com/s/y9jt5kmabt02yg8/sicp.epub?dl=0 ), but it appears to be currently out of date: Unofficial Texinfo Format 2.andresraba6.5 (January 29, 2015) ...compared to the online version ( http://sarabander.github.io/sicp/html/index.xhtml ): Unofficial Texinfo Format 2.andresraba6.6

Furthermore, I would like to be able to link directly from the Readium EPUB "cloud" reader into the sicp.epub zip file, or even better: into the exploded (unzipped) version of the EPUB. DropBox will not allow this, unless the "public web pages" feature is activated. Conversely, GitHub is very handy for this, as we can simply use the gh-pages branch to publish content online. Just as you currently do with the HTML5 version of SICP: http://sarabander.github.io/sicp/ => https://github.com/sarabander/sicp/tree/gh-pages

So, could you please pre-compile and commit+push the ready-to-use flavours of the EPUB content? Many thanks!!

PS: I tried to compile the EPUB myself using the Makefile, to no avail.

danielweck commented 8 years ago

FYI, example of Readium linking directly into a GitHub repository (does not have to be the gh-pages branch, by the way), via the magic of https://rawgit.com CDN URL: https://readium.firebaseapp.com/?epub=https%3A%2F%2Fcdn.rawgit.com%2FIDPF%2Fepub3-samples%2Fmaster%2F30%2Faccessible_epub_3 This is an exploded EPUB originating from: https://github.com/IDPF/epub3-samples/tree/master/30/accessible_epub_3

sarabander commented 8 years ago

Thanks for your feedback, I'll see what I can do.

sarabander commented 8 years ago

I put the updated epub in a new repository, here is a direct link to sicp.epub. The exploded view of the zip file is in the same repo. Let me know if this is what you had in mind. I think I'll retire the DropBox link soon and replace it with the aforesaid direct epub link.

Thanks for your interest in the SICP e-book project! I'm happy to see EPUB3 readers improving. sicp.epub has a reasonably complex structure (MathML, SVG images, web fonts, code listings with typographic enhancements) to put any reader through a good test.

danielweck commented 8 years ago

Thank you @sarabander

The "exploded" ebook (i.e. the unzipped EPUB archive) seems to load just fine in Readium (please ignore the MathML / SVG errors in the web console, there is a known Chrome 49 regression bug): https://readium.firebaseapp.com/?epub=https%3A%2F%2Fcdn.rawgit.com%2Fsarabander%2Fsicp-epub%2Fmaster%2Fexploded

Note that here I am using the https://rawgit.com CDN as a proxy to your GitHub repository. For example: https://github.com/sarabander/sicp-epub/blob/master/exploded/toc.xhtml ==> https://raw.githubusercontent.com/sarabander/sicp-epub/master/exploded/toc.xhtml ==> https://cdn.rawgit.com/sarabander/sicp-epub/master/exploded/toc.xhtml (the HTTP response for the last URL request includes the correct content-type and required CORS headers)

By the way, in your particular case I can use https://github.io directly, as the HTTP headers are set correctly via the gh-pages branch. E.g.: https://github.com/sarabander/sicp-epub/tree/gh-pages/exploded ==> https://sarabander.github.io/sicp-epub/exploded/ ==> https://readium.firebaseapp.com/?epub=https%3A%2F%2Fsarabander.github.io%2Fsicp-epub%2Fexploded

danielweck commented 8 years ago

The zipped EPUB can also be loaded directly in Readium via a HTTPS URL, but this yields inferior performance (large zip file, no streaming) and introduces severe runtime / rendering caveats (which I will not describe here, for the sake of brevity :)

In your case, the "raw" URL needs to be acquired via the Git LFS server. See:

https://github.com/sarabander/sicp-epub/blob/master/sicp.epub ==> https://github.com/sarabander/sicp-epub/blob/master/sicp.epub?raw=true ==> https://media.githubusercontent.com/media/sarabander/sicp-epub/master/sicp.epub ==> https://readium.firebaseapp.com/?epub=https%3A%2F%2Fmedia.githubusercontent.com%2Fmedia%2Fsarabander%2Fsicp-epub%2Fmaster%2Fsicp.epub

Note that the HTTP content type header is wrong (application/octet-stream, should be application/epub+zip) but Readium handles it gracefully anyway.

danielweck commented 8 years ago

FYI, Chrome v49+ regression bug workaround for MathML / MathJax / SVG now implemented in Readium (develop branch). See live app URL with SICP ebook: https://readium.firebaseapp.com/?epub=https%3A%2F%2Fcdn.rawgit.com%2Fsarabander%2Fsicp-epub%2Fmaster%2Fexploded&goto=%7B%22idref%22%3A%22x1_002e2%22%2C%22elementCfi%22%3A%22%2F4%2F4%2F218%2F2%2C%2F17%3A1%2C%2F17%3A2%22%7D

sarabander commented 8 years ago

Thanks, great work with Readium! MathML seems to render very nicely with MathJax (I didn't test with Chrome 49. I still use 45, no time to upgrade). But drop capitals are dislocated, except in Foreword and in the beginning of chapter 2.