Skip to main content
Lina_DABASINSKAITE
Community Manager
December 11, 2024

How to insert source code

  • December 11, 2024
  • 1 reply
  • 4393 views

While writing content, you can add code samples to your posts. It is important to do it as explained below to increase the readability of your content.

1. Click the “Insert/Edit” code sample button in the content editor toolbar:

Code_1.PNG

2. Select the appropriate language from the dropdown menu:

Code_2.PNG

3. Paste the sample code and click OK.

Code_3.PNG

Related articles:
How to post
Getting faster and better answers in the community
How to write your question to maximize your chances to find a solution

    1 reply

    Andrew Neil
    Super User
    December 11, 2024

    To post text where the layout matters, but which is not source code - eg, console output, tabular text, ASCII art - see:

    https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/tac-p/725146/highlight/true#M54

     

    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.