Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

How should I write code in discussion

Its somewhat frustrating that I cannot respond to answers in the discussion by simply adding < and writing code as it should be.

I assume the reason for this is security?

Is there a way that we can do write the code so it comes up with the black background manually?

Thanks.

5 Answers

Hi!

I may be wrong here but I presume that this is what you are looking for:

You can put three of these (`) before and after the code snippet to make it better formatted. If you want to see this in more detail please refer to the Markdown Cheatsheet below the post box.

You can use three tick marks (```) followed by the name of the language to start your code block. Then you end it with three more tick marks.

For example:

def initialize
    #this is some Ruby code.
end

<header> <a href="index.html" id="logo"> <h1>Testing</h1> <h2>Test</h2> </a> <nav>

They need to be the backwards marks. Top left of the keyboard.

Awesome thank you very much !!

If possible, if may be a good idea to make this clear to new users.

Hi Jake,

It is under every post/comment/answer you make:

"Reference this Markdown Cheatsheet for syntax examples for formatting your post." :)

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,863 Points

I think this post is the best for describing.

It's too bad we can't pin it. :)