That’s what I’m seeing too… It’s never struck me as particularly bland, in particular since there are other highlights that show up in the other code blocks on the linked page: greenish-blue for numbers, red for strings, gray for comments. Looks fine to me. That being said, I’m not sure that I understand what exactly gets highlighted in blue (like Symbol)… that seems buggy to me (TheStruct should be highlighted the same way).
The specific colors depend on the theme you set in your preferences on Discourse. There could be a few more things that are highlighted (like operators), but there’s just not that much going on in that code snippet. This is how it looks in my text editor:
@mbauman It definately is, but when browsing through their website, they don’t seem to fail as much (for anyone looking, Julia is in the premium “misc” category ). Cliking through their styles, most of the works pretty fine.
I have Monokai set up in VSCode, would like to make some tweaks to it, if I had time, but it makes stuff much clearer.
@cormullion and @fredrikekre looks great to me. not sure if there shouldn’t maybe be a vote for a style to put on Discourse. But basically anything would be better then the current minimal highlight.
Does the custom highlight.js schemes work in VSCode? I would be nice to try it out.
To my knowledge, Fredrik’s branch has not (yet) been upstreamed into highlights.js. It’d be great if it could!
Just to be clear, the things we have control over on Discourse are:
The default highlighting language — this is set to julia
The enabled highlighting languages — this is set to 33 languages and we can add more if you find it’d be helpful.
List of currently enabled languages
I think the themes’ CSS should be able to override the default styling of the identifiers. This doesn’t change which identifiers and syntaxes are highlighted, but it changes how they are highlighted. The defaults are here pulled from code_highlighting.scss I believe.
All of this is completely unrelated to how VS Code does its highlighting, which is powered by TextMate grammars.
I was thinking that discourse gives you access to highlight.js options and admins can choose the style to go with etc.
The thing is, I tried other languages that came to my mind and all of them have the same problem.
But from the link it would seem that Discourse in general picks a handful of tokens to highlight for all languages and that’s it.
Do I get it right?
Yeah, I know that it is unrelated to VSC, was just curious if anyone here tried using highlight.js there. (quick googling doesn’t show any extensions for that, so probably not possible).