syntax highlighting with tree-sitter

25 points by fanf


matklad

+1 to writing your own SSG for personal blog, in my experience it is way easier to maintain.

You might want to add something like this to your style:

https://github.com/matklad/matklad.github.io/blob/6833f64d8d1ea81da90be90e206d7a2498d850ba/content/css/main.css#L101

Right now, on mobile, overflowing code blog generates a horizontal scroll bar for the entire website, bot just for the code block itself.

I am somewhat skeptical about using TreeSitter for syntax highlighting in many contexts: for high quality stuff, you need access to language semantics, for something that just looks good, a bunch of regexes would be way simpler.