Live data from Hacker News

Entire website in a single HTML file

css-tricks.com

71–80 of 333 posts

Re: Entire website in a single HTML file

#72

Earlier quoted context omitted.

Been doing this for over half a decade off of a template I boosted 8 years ago and have been modifying since. Has made tens of millions in revenue. Just assumed every developer or template seller in south asia was using this - or their clients. Probably more common than you think.

So you are using a single HTML file with no JS at all to deliver a multi-page site? Just to be clear.

To be clear, yes. With the section tag. Sometimes I even add javascript to the style section without any object orientation. Stop the presses.

Re: Entire website in a single HTML file

#73
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.

> but unfortunately Adobe didn't invest much time or money into making them interactive with a scripting language.

Yes, they did. (Non-Adobe readers often don't support JS, though some do, but Adobe definitely built the support for interactivity.)

Also 3D content and a lot of other things most people probably aren't aware of, because they are peripheral to the common use cases of PDF.

Re: Entire website in a single HTML file

#74
I may be missing the point here (so please correct me if I am), but 'anchor' has been around for ages. I have seen several tutorial sites which use such elements to typically add a Hint to some discussion. Is there something novel have I missed?

Re: Entire website in a single HTML file

#75
post #35
post #31

Earlier quoted context omitted.

I wouldn't call that a limitation. In fact that is one of the major selling points of the PDF format. The document looks as intended* by the creator on all platforms whether display or print media. * Yes, I know, PDF doesn't -always- do this, but a well designed PDF generally does.

It is a limitation. Anyone who's ever tried to read a PDF journal article on their phone has experienced it. (and don't even get me started on Unicode copy/paste...) HTML can be styled in a fixed layout if desired, and reflowed by a reader mode if needed. PDF can't be styled in a responsive way, and there's no (easily accessible) reader mode equivalent for PDFs. HTML is a far better document format than PDF.

> there's no (easily accessible) reader mode equivalent for PDFs.

It’s called Liquid Mode in Reader, and it is, in fact, easily accessible.

> HTML is a far better document format than PDF.

HTML is better for some things, PDF for others. That's why PDF is widely used on the web when HTML is available.

Re: Entire website in a single HTML file

#79
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…

Yes, maybe something like https://portable.fyi/#2021-01-02-pocket-web-books.

Re: Entire website in a single HTML file

#80

Earlier quoted context omitted.

So you are using a single HTML file with no JS at all to deliver a multi-page site? Just to be clear.

To be clear, yes. With the section tag. Sometimes I even add javascript to the style section without any object orientation. Stop the presses.

That's the thing, I think most designers were probably using javascript even if alongside tricks like this without thinking it through. The current period in web design is one of the biggest "it's nice to have javascript turned off" moments we've had, so it's relevant.

If you already knew about this, the post seems like a joke, you've made millions off this for years now--that's really special, but that is also pretty subjective and doesn't mean it's not meaningful that one of the top CSS sites shared this article out this year.

Post reply on HN