Comment by atoav

1 year ago

> Just use a code editor with Syntax Highlighting! Vim solved this decades ago!

You are aware that this blog post is about displaying syntax highlighted code on the web? This is literally explained in the first paragraphs of the blog post..

As of now there were four ways of doing that:

1. using an image (which sucks)

2. manually setting the colors (good luck)

3. Generating the syntax highlighting server-side (preferred, but you need a backend that can do it)

4. Generating it client side using JS (waste of energy, takes a time to finish)

And now a font. Depending on the use case this could be a feasible option, although I am just waiting for this to be exploited in some fashion.

I still think computing once styling later is preferable.

Yes, and I still believe editing text is painful on a browser and this is just putting lipstick on a pig.

Keyboard shortcuts and auto-complete being important pain points.

  • This is for publishing web pages talking about code.

    The author would like to hand code HTML for such web pages that would present syntax highlighted code to the web page reader, without requiring or resorting to typical js highlighting or screenshots.

    None of editing in the terminal, nor an IDE, nor a browser are related to this use case.

    • However, the highlighting examples do not work with JS disabled (I think because JS is used to load the fonts) so what is the advantage of not using JS for highlighting over calling a JS highlighter on <code> tags?