5 ms·
> 5. Finally, just distribute it in a zip file. That's how ebooks already work right? What about self-extracting ZIP files like this page? https://gildas-lorme
by gildas 3y ago
> 5. Finally, just distribute it in a zip file. That's how ebooks already work right?
What about self-extracting ZIP files like this page? https://gildas-lormeau.github.io/ https://gildas-lormeau.github.io/ (note that it includes the CSP to make it safe)
- asimpletune 3y agoI don't think there's any CSP? https://observatory.mozilla.org/analyze/gildas-lormeau.github.io https://observatory.mozilla.org/analyze/gildas-lormeau.githu... In any case, ideally, any ebook solution should have all resources loaded as files relative to the current document, and nothing inline. Like this, the book would be compatible both offline and to be hosted online, without requiring any changes to the book. The one file thing is cool, but again it requires JS to show anything, so that's not really inline with what I was talking about. In my view, an HTML document should work like a book, and any JS is purely to augment and extend that book if necessary. Those situations are rare though, and most JS is just to give a reader like experience. I think if someone is going to go through the trouble to host a book, they probably don't mind unziping a file before putting it on their server. The one file thing I said earlier was more about sharing the book, similar to an app package. but once it's on someone's servers presumably it's ready to be read. Basically .webarchive
- gildas 3y agoThe index page is protected via CSP. The "bootstrap" page which unzips the page isn't but it could. I just did not include it for some reasons I've forgotten. The JS is not essential, there's nothing to stop you treating the file as a ZIP file and unzipping it beforehand to view it.
- asimpletune 3y agoOk, well maybe the example provided doesn't communicate the intention, because when I try to 'extract' the page, following the download links, they don't work, except the png. Cool concept though.
- gildas 3y agoUnfortunately, the file poses a problem for basic unzipping software (e.g. a file explorer). However, the file is 100% valid with respect to the ZIP specification. You just need to use "true" unzipping software like 7zip, unzip etc. to read it as such.
- emmanueloga_ 3y agoSuper interesting! Haven't seen this before. Very creative (abuse?) of zip files! :-) https://github.com/gildas-lormeau/SingleFile/blob/master/faq.md#how-does-the-self-extracting-zip-format-work https://github.com/gildas-lormeau/SingleFile/blob/master/faq...