How to Format Code in the Forums

This topic contains 0 replies, has 1 voice, and was last updated by Profile photo of Don Jones Don Jones 10 months, 1 week ago.

  • Author
    Posts
  • #39389
    Profile photo of Don Jones
    Don Jones
    Keymaster

    You can, and should, format code snippets for easier reading. Right above the posting text box are three bullets to remind you how to do it. Here's the longer explanation:

    Use HTML "pre" tags (not "code") around your code. There's even a button in the editor to do this for you. The tags look like this:

    [PRE][/PRE]

    Except that you use angle brackets, not square brackets.

    You cannot use backticks. Pressing the "code" button in the editor will insert backticks. These will not work correctly in all situations. Use PRE tags instead.

    You can also post your code as a Gist on GitHub. Each Gist has a unique URL; simply paste that URL into your forums post and we'll grab and format the code when your post is displayed. You can even edit the Gist, and we'll always show the most recent version. This is recommended, as other users can also visit the Gist directly for easier reading, or to download it.

The topic ‘How to Format Code in the Forums’ is closed to new replies.