News for hackers. Stuff that matters.
Re:Entire website in a single HTML file by AdmiralAsshat on Thursday December 23, 2021 @10:09PM (#29669614)
I think you've just described an EPUB?
Re:Entire website in a single HTML file by tingletech on Thursday December 23, 2021 @10:44PM (#29669904)
I thought epub files were basically zip archives of all the required files
Re:Entire website in a single HTML file by dredmorbius on Thursday December 23, 2021 @11:38PM (#29670265)
ePub, as with PDF, is a container-file format. (A ZIP file with a specified structure.)

If you want to consider that single or multiple files ... quickly veers into semantics.

Re:Entire website in a single HTML file by ryantriangles on Friday December 24, 2021 @11:59AM (#29675203)
An epub is indeed a zip file containing HTML, CSS, font, image, and metadata files.

I'd argue that that's not meaningfully different to OP's suggestion of a HTML file with all the content inlined, though. It's still a single file grouping everything required together and can be easily edited and read practically anywhere. It has a few advantages over the inlined-content HTML file, too:

- You can read the compressed file directly, an epub being typically half the size of the uncompressed files (going by a quick test of 30 randomly-selected files I had on hand).

- Storing the actual JPEG, PNG, OTF, etc files inside the zip is more efficient than inlining them as base64 and then making the browser decode them, in terms of both speed and filesize.

- While reading an epub, different sections can be a different HTML files, and only one needs to be loaded into memory at a time. This can be irrelevant for smaller things but it can make a big difference sometimes--with pages that include many charts and tables, documentation for graphics libraries that include images and animations for each documented function, etc.

- Epub files have native support for highlighting and bookmarking, to keep your place in long documents and share the file with your highlights attached.

Re:Entire website in a single HTML file by m-p-3 on Thursday December 23, 2021 @11:32PM (#29670228)
You could make an ePub of a single HTML file with all the binary blobs embedded.