up vote 3 down vote accepted

This is now enabled across the site, but you likely won't see it being applied because of your tagging structure. Normally, syntax highlighting is set on each tag, but since questions here don't really use language tags, there's nothing to attach those defaults to for highlighting and it will mostly be manual.

We can, however, set a single language to highlight by default across the entire site if all code is mostly done in the same language. Taking a cursory glance around at example, it's looking like that's mostly be lang-c - so we could set that as the global default and any cases where that's not appropriate could override it manually. Just let us know.

  • Hi, thanks @animuson and welcome to this site ;) – MEE Aug 24 at 4:58
  • Thanks! A global lang-cpp tag would be nice! – TeeAttack42 Aug 24 at 15:15
  • @TeeAttack42 We set global highlighting to "default" since that works very well for C++, but will not completely break if someone decides to post something else, like XML. – animuson Aug 29 at 18:40

I think @mee is correct, to enable colors highlighting it appears we need to:

  • request through a feature request that certain languages be enabled (say lang-cpp) which would allow users to provide language hints in their answers such as <!-- language: lang-cpp -->. Language hints on eosio.stackexchange are currently ignore, and syntax highlighting just defaults to grey.

  • and also we could request that some tags be associated with a default language. The default language for all tags lang-none which again is just plain grey.

For more info see the Note to editors in this answer: What is syntax highlighting and how does it work?

  • Any progress on this? Syntax highlighting would be really useful – confused00 Jul 26 at 22:39
  • I am not sure how to move this forward, I think one of our mods might need to get involved, I've tried pinging them. – Vlad Jul 27 at 18:00
  • 1
    I will investigate how to raise this feature-request correctly! – TeeAttack42 Jul 28 at 10:39
  • 1
    I have written a message to @RobertCartaino (our stackexchange community manger). Will keep you guys updated. – TeeAttack42 Jul 29 at 16:31

We already have code highlighting. It's great to have since people are often cross referencing EOS code or github snippets.

You can either do multiline:

multiline
code

Or section of a paragraph like this.

https://meta.stackexchange.com/a/22189/185661

  • Yes but it does not seem to be enabled – MEE Jun 7 at 7:27
  • 1
    I mean: Yes there is code formatting, but no code highlighting (colors) enabled – MEE Jun 7 at 9:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .