I’m wondering about code syntax highlighting… According to the docs on code blocks (which is referenced in this post), there should be syntax highlighting for languages, but there isn’t… there is some syntax highlighting if no language is specified, but if the language is specified, there is no highlighting at all…
Code highlighting has always been weird on discourse and I never fully figured it out.
There is a setting to enable and disable code hightlighting for different languages. @IanAtCSTeach can you share a screenshot of that and update the guide accordingly?
Discourse automatically detects the language and highlights it as such.
Sometimes there is sometimes there is not.
When I make an edit to improve formatting I may just do the wrong abbreviation after the first backticks making it so there is no highlighting. If you notice I did that going on feel free to send me a message and I will fix it.
Hmm… actually it seems that code formatting is working fine, it’s just that despite the fact that the docs state
js should work for syntax highlighting, it doesn’t…
Same with Python actually:
It seems the shortcut names which are supposed to work don’t…
Actually, not even the shortcut names, it just seems only certain names work, like for
c++ seems to work, not
cplusplus as stated in the docs, and for
csharp works, not
hmm… Let me look if there is some stuff on meta about code hightlighting.
@MattDESTROYER I found this meta post and these docs on what supported languages are¹ and what the aliases are. For example
gyp should all work for Python. And
¹Not all are supported due to the setting.
It’s not necessary to click Cover Page, is it?
No, but if you just copied while focusing on a tab with a file then it would link directly to that file instead of the usual cover page.
Also the post originally said “spotlight page” so I just changed it to “cover page”
Yeah, but you could view main file or even just get rid of after the # in the URL…