Skip to main content
TDK
Super User
January 23, 2024
Solved

Formatting code should be easier

  • January 23, 2024
  • 5 replies
  • 15431 views

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?)
    Best answer by Laurids_PETERSEN

    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

     

    5 replies

    Andrew Neil
    Super User
    January 24, 2024

    Absolutely this!

    This is such a long-standing issue - not only here but on pretty much all similar forums - that you'd have thought we should be past it by now!

    :face_with_rolling_eyes:

     

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Andrew Neil
    Super User
    January 24, 2024

    I'll just leave this here, so that I can easily find it again when needed - and anyone else feel free to copy & paste:

     

    Use this button to properly post source code:

    AndrewNeil_0-1706092844578.png

    To get that extra row of icons, press this button:

    AndrewNeil_1-1706092844581.png

     

     

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    TDK
    TDKAuthor
    Super User
    January 26, 2024

    @Lina_DABASINSKAITE Why did you accept a solution here? The problem wasn't asking how to format code, it was a suggestion to move it out of its hidden location so users can find it easier.

    If the UI was improved, users wouldn't have to go find instructions for how to do something basic.

    "If you feel a post has answered your question, please click ""Accept as Solution""."
    Andrew Neil
    Super User
    January 26, 2024

    Although, to be fair, on forums where it's in plain view it still doesn't get used - so hiding it absolutely guarantees it won't get used.

    Users won't just find it; they need to be explicitly shown it.

    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.

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Andrew Neil
    Super User
    March 8, 2024

    @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?

     

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Laurids_PETERSEN
    Community Manager
    January 29, 2024

    Hi @TDK and @Andrew Neil 

    Thanks for your feedback on this matter.

    I have reached out to our support and requested that the "insert/edit code sample" button be relocated, so that it appears on the main toolbar.

    I appreciate your input on the removal of other features in the text editor. This is also considered for future changes. For now, the main priority is the button relocation.

    Best regards,
    Laurids 

    Andrew Neil
    Super User
    January 29, 2024

    @Laurids_PETERSEN wrote:

     For now, the main priority is the button relocation.


    :thumbs_up:

    If you need to make space to do that (which would be understandable), the 'Bullet list' and 'Numbered list' could certainly be relegated to the 2nd row. They really aren't key features at all!

    AndrewNeil_0-1706523395629.png

     

     

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Laurids_PETERSEN
    Community Manager
    January 29, 2024

    Thanks for the suggestion @Andrew Neil

    This is about the same way that I would like to approach this. My current suggestion is to have the code template placed between the "numbered list" and "quote."
    This would mean that the "insert video" function moves into the expanded toolbar.

    Moving forward, preferences for the first-row toolbar functionalities may vary based on individual opinions and use.
    If you have the time, I would be keen to know which buttons (10) you consider most suitable for the first toolbar. @TDK feel free to send your suggestions as well. 

    You can either reply in this thread or send me a private message and I will get back to you. 

    I will keep you posted regarding any changes.

    Best regards,
    Laurids 

    Associate III
    March 8, 2024

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

    Andrew Neil
    Super User
    March 8, 2024

    Pardon? 

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Associate III
    March 8, 2024

    I was answering to that


    • Spoiler tags. (Why is this a thing at all?)
    Andrew Neil
    Super User
    May 10, 2024
    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Lina_DABASINSKAITE
    Community Manager
    May 14, 2024

    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.