How to post code?

Hi, I am about to write a post asking advice, and would like to post the code in question. I’m pretty sure pasting the whole file into the post isn’t the way to do it. Could someone tell me the accepted way? Thanks.

If you have your code on GitHub, post a link to the GitHub location. It will post a snippet of code and allow people to click the link to view everything.

+1 on the Github link.
If you are talking about small snippets of code, wrap it in [code] [/code> tags (replace the > with ]).

1 Like