When you post code, expand the toolbar:
In the expanded toolbar, click more and Syntax highlighter:
Select the language (for instance Python):
Paste you code:
Click OK in the lower part of the screen
And the code will appear with the correct format:
and to tie in all the links...
/blogs/dan_patterson/2016/08/14/script-formatting
I'd like to also add suggestion of copying your code to something like notepad or notepad++ to deal with spacing/wraparound and then past it back into the codeblock per Dan Patterson suggestion in comments found here.
I would also like to point out that you can't edit a code block in place. You have to left click in it to select the block, then repeat the steps above to open the syntax highlighter.
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.