Live data from Hacker News

Entire website in a single HTML file

css-tricks.com

91–100 of 333 posts

Re: Entire website in a single HTML file

#91
post #84

HTML and CSS alone are really powerful. I decided not to use any JS on my personal site, but you can still have: + collapsible sections with `details` and `summary`[0] + footnotes, with navigation to/from with anchor tags. You can even apply CSS on the currently selected footnote.[1] + Semantic web that is compatible with everything and has sensible defaults so you can focus on what you're actually doing! + Tiny depl…

You like to live in hard mode. I like that.

Re: Entire website in a single HTML file

#92
This reminds me strongly of the Info file format (itself generated from a TexInfo source file), in which an entire multi-page document is presented in a single file. See:

https://www.gnu.org/software/texinfo/manual/texinfo/html_nod...

The difference is that Info requires a dedicates reader (the info or pinfo command-line utilities, or of course, Emacs), whilst this format will work with any graphical Web client.

It doesn't quite work as planned with a terminal-based browser. I've opened https://css-tricks.com/a-whole-website-in-a-single-html-file... with w3m, and rather than seeing only one of the intended "pages" at a time, the entire "site" is presented. That said, degredation is graceful, and navigation works.

I'm quite impressed.

Re: Entire website in a single HTML file

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

Keep in mind that single integrated book formats are highly viable now.

It's in the interest of publishers not to offer them, however.

A chief example that comes to mind is the Feynman Lectures in Physics series, which are available online but only in a chapter-by-chapter basis in HTML format. (Quite beautifully formatted, FWIW.) If you want to glue those together into a single integrated whole, you'll have to do that yourself.

PDFs and ePubs afford the single-file format.

Re: Entire website in a single HTML file

#94
post #84

HTML and CSS alone are really powerful. I decided not to use any JS on my personal site, but you can still have: + collapsible sections with `details` and `summary`[0] + footnotes, with navigation to/from with anchor tags. You can even apply CSS on the currently selected footnote.[1] + Semantic web that is compatible with everything and has sensible defaults so you can focus on what you're actually doing! + Tiny depl…

Thanks for sharing, beautiful site. Great typography.

Re: Entire website in a single HTML file

#95
post #41

This looks like one of those sites I made as a kid. What is the significance of this?

The only slightly interesting part (which is why it's hosted on css-tricks) is not even explicitly mentioned in the article at all. It's the fact that it also uses no JS, and is all CSS based. Obviously that itself isn't crazy, though back in our days it would've been harder to do with old CSS. That is, having proper navigation/sections.

Re: Entire website in a single HTML file

#96
post #42

Anyone here absolutely godsmacked that this is the top news on HN? The hell happened? Did I get cryogenically frozen and just woke up?

I had the same reaction. It would be like telling someone who has been using an IDE: did you know you can compile your code from the command line? And having that person genuinely be blown away.

https://xkcd.com/1053/

Re: Entire website in a single HTML file

#98
post #84

HTML and CSS alone are really powerful. I decided not to use any JS on my personal site, but you can still have: + collapsible sections with `details` and `summary`[0] + footnotes, with navigation to/from with anchor tags. You can even apply CSS on the currently selected footnote.[1] + Semantic web that is compatible with everything and has sensible defaults so you can focus on what you're actually doing! + Tiny depl…

I’d want templating if I’m going to make more than two pages on a site.

Re: Entire website in a single HTML file

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

Keep in mind that single integrated book formats are highly viable now. It's in the interest of publishers not to offer them, however. A chief example that comes to mind is the Feynman Lectures in Physics series, which are available online but only in a chapter-by-chapter basis in HTML format. (Quite beautifully formatted, FWIW.) If you want to glue those together into a single integrated whole, you'll have to do tha…

It makes sense from a DRM standpoint - PDFs and ePub are easy to crack if you offer it at all, so the only way to fix this is to go web-only and assume nobody will want to dig into turning that into a sharable PDF. Bonus points if you make it a SaaS test platform and get universities to buy into it, forcing every student to purchase the 'book' to receive grades.

Re: Entire website in a single HTML file

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

[deleted]
Post reply on HN