cancel
Showing results for 
Search instead for 
Did you mean: 

Formatting code should be easier

TDK
Guru

Problem:

There are a significant amount of threads where code is pasted as plaintext a thread. As an example, this one, where the user clearly searched for a way to format it as code but couldn't find how:

https://community.st.com/t5/stm32-mcus-products/failing-to-read-useful-data-from-adc-of-stm32f411/td-p/631535

The underlying issue is that formatting a code block is hidden behind the "..." in the editor.

TDK_0-1706038224051.png

This is despite having more than enough room to accommodate such an important feature.

Suggesting:

Consider promoting the code formatting to the main toolbar and relegating the following near-useless features to the "..." abyss:

  • Spoiler tags. (Why is this a thing at all?)
  • Insert video.
  • Change font.
  • Change font size.
  • Chang text color.
  • Run macro. (What even is this?)
If you feel a post has answered your question, please click "Accept as Solution".
18 REPLIES 18

Thanks @TDK,
The "insert/edit code sample" is now visible in the top toolbar. This should assist users in finding the functionality better.

@Andrew Neil Thanks for suggesting the addition of the code template to "tips on posting". Having more visibility on the functionalities of the text editor is on the to-do list. 

Best regards,
Laurids

 


@Laurids_PETERSEN wrote:

Thanks @TDK,
The "insert/edit code sample" is now visible in the top toolbar.


So it is!  :thumbs_up: :beaming_face_with_smiling_eyes:

 

Use this button to properly post source code:

AndrewNeil_1-1707302513396.png

 

Thank you! Should be easier to find now.

If you feel a post has answered your question, please click "Accept as Solution".

@Andrew Neil wrote:

Although, to be fair, on forums where it's in plain view it still doesn't get used.


And sadly (though not surprisingly), it continues to not get used:

https://community.st.com/t5/feedback-forum/detect-mis-posted-source-code/td-p/648157

 

 


@Andrew Neil wrote:

It's now quite common on forums that new users have to take a "tour" before being allowed to post - to make sure they know things like this.


How about it?

 

By the way I find "spoiler tags" useful to show long output, or to avoid an overloaded post

Pardon? 

I was answering to that


  • Spoiler tags. (Why is this a thing at all?)

Thanks @Andrew Neil , great suggestion! I added it ;) 


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.