3 Answers 3

5

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.

3
  • Hi, thanks @animuson and welcome to this site ;)
    – MEE
    Aug 24, 2018 at 4:58
  • Thanks! A global lang-cpp tag would be nice!
    – tmm Mod
    Aug 24, 2018 at 15:15
  • 1
    @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 StaffMod
    Aug 29, 2018 at 18:40
3

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?

4
  • Any progress on this? Syntax highlighting would be really useful
    – confused00
    Jul 26, 2018 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, 2018 at 18:00
  • 1
    I will investigate how to raise this feature-request correctly!
    – tmm Mod
    Jul 28, 2018 at 10:39
  • 1
    I have written a message to @RobertCartaino (our stackexchange community manger). Will keep you guys updated.
    – tmm Mod
    Jul 29, 2018 at 16:31
0

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

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

You must log in to answer this question.

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