Live data from Hacker News

Entire website in a single HTML file

css-tricks.com

21–30 of 333 posts

Re: Entire website in a single HTML file

#22
post #8

This is something I've always wanted for virtual textbooks. A single .html file with all the JS, CSS, images as inline data blobs, etc. For most physics, math, CS, etc books, this should be possible. It would make it trivial to download the book for offline use and share it with others. Other than the raster images, the entire content of these types of books would probably fit in a couple MB of text. The use of #anch…

And images can be also embedded. These days you can fake a real URL completely on a fronted side.

Re: Entire website in a single HTML file

#24
post #21

My gut instinct is that these CSS tricks may be bad for accessibility. Does anyone know how well a screen reader would deal with it?

i recently read that display:none elements are hidden from screen readers

I wonder whether, upon clicking the links, there is any indication about the change in visible content.

Re: Entire website in a single HTML file

#25
post #8

This is something I've always wanted for virtual textbooks. A single .html file with all the JS, CSS, images as inline data blobs, etc. For most physics, math, CS, etc books, this should be possible. It would make it trivial to download the book for offline use and share it with others. Other than the raster images, the entire content of these types of books would probably fit in a couple MB of text. The use of #anch…

You're describing PDF files, but unfortunately Adobe didn't invest much time or money into making them interactive with a scripting language.

PDF has a limitation: it defines page size and the layout of everything fixed to this page, and thus can't do responsive layout like HTML can (reorganizing stuff in the page to match the screen size)

Re: Entire website in a single HTML file

#26
post #3

How is this news? React SPAs have been around for years, and SPAs existed long before React too.

This thing is fast unlike anything built as a spa nowadays that make your laptops fan spin so fast it wants to take off.

It's fully possible to build fast SPAs.

Though almost no one is able to do it.

Which is weird, as it's objectively easier than writing enterprise react crap.

Re: Entire website in a single HTML file

#27
post #19
post #3

How is this news? React SPAs have been around for years, and SPAs existed long before React too.

No, not a SPA. There is a concept of a single file app (SFA). You can share an html file, and that is the application. It can have inlined micro js/css frameworks, or hand-rolled everything. An SFA should be human readable though- viewing the page source is useful. I think it’s a concept worth exploring.

But what is the benefit?

Re: Entire website in a single HTML file

#29
post #8

This is something I've always wanted for virtual textbooks. A single .html file with all the JS, CSS, images as inline data blobs, etc. For most physics, math, CS, etc books, this should be possible. It would make it trivial to download the book for offline use and share it with others. Other than the raster images, the entire content of these types of books would probably fit in a couple MB of text. The use of #anch…

MHT did this 20 years ago and got all but abandoned (probably for good reasons).
Post reply on HN