Hacker News new | ask | show | jobs
by saityi 2224 days ago
I tried to apply the philosophy of keeping things as simple as possible while writing https://saityi.github.io/sml-tour

Initially, I wanted no JS and for it to look good in a text-based browser like links, too, but I've strayed from that a bit. Syntax highlighting of the code examples was easiest with a javascript include, and the TOC is a mess hidden by CSS, so it looks particularly egregious in text-based browsers.

The website is still functional without JS and text-only, though, and without the favicon and syntax highlighting it comes in at ~4kb to load a page, which I'm happy with; with them it's closer to 40kb, which isn't the worst.

1 comments

Why not do the syntax highlighting beforehand instead of on the fly? For example, I use Rouge to highlight all my code as the site is generated.
No reason at all; I think I will go look into doing that now. I think it should be a quick fix :)

Thank you for the idea!

Now complete -- thanks again for the suggestion! I never liked having to include that bit of JS.
It looks great!