vlang / website

MIT License
62 stars 96 forks source link

Syntax highlighting #246

Open AntonioNoack opened 1 year ago

AntonioNoack commented 1 year ago

Description

Only very few people are coding without syntax highlighting, and imo it greatly improves readability. I'd suggest that the example code on your website gets syntax highlighting.

Current state: image

Good

I'm coming from the Kotlin world, so I'd like colors like these: image

Features: keywords (orange), declared function names (yellow), struct members (lavender), strings (green), comments (slightly different green) and numbers (light blue) have different colors.

For libraries, popular ones like highlight.js or prism.js should work fine.

Bad

Please don't use the colors that Zig uses. I think that keywords shouldn't be more prominent than regular text, because they contain similar or less information than function calls and expressions. Zig somehow decided that bold and bright is appropriate for them 🤦‍♂️. Also the text in Zig's preview has not enough contrast to the background in my opinion. image

Contribution?

I may be able to implement that, but I'll have to see how your project is structured, and how to integrate new JavaScript libraries first.